From 9b4710d386cfedfcbfe3e2eff1a74b1ccdded434 Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Tue, 17 Dec 2024 21:04:36 +0000 Subject: [PATCH] show time in main menu, change battery % symbol to use a small version --- sphaira/source/ui/menus/menu_base.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sphaira/source/ui/menus/menu_base.cpp b/sphaira/source/ui/menus/menu_base.cpp index 533787a..d105249 100644 --- a/sphaira/source/ui/menus/menu_base.cpp +++ b/sphaira/source/ui/menus/menu_base.cpp @@ -32,6 +32,13 @@ void MenuBase::Draw(NVGcontext* vg, Theme* theme) { u32 strength{}; u32 ip{}; + const auto _time = time(NULL); + struct tm tm{}; + const auto gmt = gmtime(&_time); + if (gmt) { + tm = *gmt; + } + // todo: app thread poll every 1s and this query the result psmGetBatteryChargePercentage(&battery_percetange); psmGetChargerType(&charger_type); @@ -54,7 +61,8 @@ void MenuBase::Draw(NVGcontext* vg, Theme* theme) { start_x -= spacing; // draw("version %s", APP_VERSION); - draw("%u%%", battery_percetange); + draw("%u\uFE6A", battery_percetange); + draw("%02u:%02u:%02u", tm.tm_hour, tm.tm_min, tm.tm_sec); if (ip) { draw("%u.%u.%u.%u", ip&0xFF, (ip>>8)&0xFF, (ip>>16)&0xFF, (ip>>24)&0xFF); } else {