From dd87265d2944528d820515aedd6b02b63d10e54a Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Tue, 8 Sep 2026 10:49:40 +0200 Subject: [PATCH] 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 --- examples/companion_radio/ui-new/UITask.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 3650b903..5eabc5ce 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -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"};