mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
fix(ui): lock screen clock no longer overlaps its own title bar
PR #32 added a title bar (battery + status icons) to the LOCK page but its drawClockTime() call still started at top_y=0, same row the title bar draws into -- renderBatteryIndicator() runs unconditionally for any _page != CLOCK (LOCK included), only the node-name text is skipped for LOCK specifically. Landscape panels could overlap the icon row whenever enough status badges (BT/GPS/alarm/mute/advert/trail/repeater) are active; portrait e-ink's huge size-4 HH/MM block (the only board shape that hits drawClockTime()'s "tall" branch) is worst hit, since it's designed to fill most of the narrow width. Starts at top_y=lh now, clearing the title bar row, matching how every other non-CLOCK page already reserves that space via content_y. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -938,7 +938,11 @@ public:
|
||||
struct tm* ti = gmtime(&t);
|
||||
char buf[12];
|
||||
bool h12 = _node_prefs && _node_prefs->clock_12h;
|
||||
int date_y = drawClockTime(display, 0, ti, h12, /*show_sec*/false);
|
||||
// top_y=lh, not 0: the title bar (battery + status icons, drawn above
|
||||
// for every _page != CLOCK, LOCK included) already occupies row 0 --
|
||||
// starting the clock there overlapped it, worst on portrait e-ink's
|
||||
// huge (size-4) HH/MM block, which fills most of the narrow width.
|
||||
int date_y = drawClockTime(display, lh, ti, h12, /*show_sec*/false);
|
||||
display.setTextSize(1);
|
||||
static const char* wd[] = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
|
||||
static const char* mo[] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
|
||||
|
||||
Reference in New Issue
Block a user