Add Wi-Fi signal indicator

This commit is contained in:
Pk11 2022-08-20 16:34:31 -05:00
commit ba63a53bbf
10 changed files with 22 additions and 0 deletions

View file

@ -11,6 +11,10 @@ sprites/battery/battery_4.png
sprites/battery/battery_blink.png sprites/battery/battery_blink.png
sprites/battery/battery_charge.png sprites/battery/battery_charge.png
sprites/battery/battery_charge_full.png sprites/battery/battery_charge_full.png
sprites/wifi/wifi_0.png
sprites/wifi/wifi_1.png
sprites/wifi/wifi_2.png
sprites/wifi/wifi_3.png
sprites/cancel.png sprites/cancel.png
sprites/checked.png sprites/checked.png
sprites/delete.png sprites/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

View file

@ -51,6 +51,7 @@ namespace GFX {
void DrawTime(); void DrawTime();
void DrawBattery(); void DrawBattery();
void HandleBattery(); void HandleBattery();
void DrawWifi();
void DrawIcon(const int Idx, int X, int Y, uint32_t Color = UIThemes->SideBarIconColor(), float BlendPower = 1.0f, float ScaleX = 1, float ScaleY = 1); void DrawIcon(const int Idx, int X, int Y, uint32_t Color = UIThemes->SideBarIconColor(), float BlendPower = 1.0f, float ScaleX = 1, float ScaleY = 1);
}; };

View file

@ -173,6 +173,21 @@ void GFX::HandleBattery() {
} }
} }
/*
Draws the Wi-Fi signal icon
*/
void GFX::DrawWifi() {
constexpr int wifiIcons[] = {
sprites_wifi_0_idx,
sprites_wifi_1_idx,
sprites_wifi_2_idx,
sprites_wifi_3_idx
};
u8 level = osGetWifiStrength();
GFX::DrawIcon(wifiIcons[level], 330, 0, UIThemes->TextColor());
}
/* /*
Draws the sidebar icons blended with the SideBarIconColor. Draws the sidebar icons blended with the SideBarIconColor.
*/ */

View file

@ -129,6 +129,7 @@ void StoreUtils::DrawDownList(const std::vector<std::string> &entries, bool fetc
GFX::DrawTime(); GFX::DrawTime();
GFX::DrawBattery(); GFX::DrawBattery();
GFX::DrawWifi();
Animation::QueueEntryDone(); Animation::QueueEntryDone();
GFX::DrawBottom(); GFX::DrawBottom();

View file

@ -130,6 +130,7 @@ void MainScreen::Draw(void) const {
config->list() ? StoreUtils::DrawList() : StoreUtils::DrawGrid(); config->list() ? StoreUtils::DrawList() : StoreUtils::DrawGrid();
GFX::DrawTime(); GFX::DrawTime();
GFX::DrawBattery(); GFX::DrawBattery();
GFX::DrawWifi();
Animation::QueueEntryDone(); Animation::QueueEntryDone();
/* Download-ception. */ /* Download-ception. */