From 2b4f2bc29eafa180f48d446de3eeb4e516eecadb Mon Sep 17 00:00:00 2001 From: Kaj Schittecat Date: Wed, 24 Jun 2026 14:47:15 +0200 Subject: [PATCH] touch: fix status-bar clock overlapping the node name on the V4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The clock's runtime placement used the wide-bar -142 offset on every board, overriding the V4's intended -126 build slot. On the narrow V4 portrait bar that pulled the clock left into the width-capped node-name window — the long-standing 'clock overlaps the name' issue. Make the placement bar-width-aware: <300 px bars (V4) use -126/-94, wide bars (T-Deck/Tanmatsu) keep -142/-110. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui-touch/UITask.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ui-touch/UITask.cpp b/src/ui-touch/UITask.cpp index 2e1b31c..cf1fa6c 100644 --- a/src/ui-touch/UITask.cpp +++ b/src/ui-touch/UITask.cpp @@ -26076,7 +26076,15 @@ static void updateGlobalStatusBar() { if (want != s_clk_center || (!want && charging != s_clk_chg)) { s_clk_center = want; s_clk_chg = charging; if (want) lv_obj_align(g_statusbar.clock, LV_ALIGN_CENTER, 0, 0); - else lv_obj_align(g_statusbar.clock, LV_ALIGN_RIGHT_MID, charging ? -110 : -142, 0); + else { + // The narrow V4 portrait bar (<300 px) has no sleep-moon slot, so the clock must sit at + // its intended -126 build position; the wide-bar -142 ran it into the width-capped + // node-name window on the left (the long-standing "clock overlaps the name" bug). The + // wide T-Deck / Tanmatsu bars keep -142. Charging slides it +32 as the % column hides. + const bool narrow_bar = lv_disp_get_hor_res(nullptr) < 300; + const int clk_x = narrow_bar ? (charging ? -94 : -126) : (charging ? -110 : -142); + lv_obj_align(g_statusbar.clock, LV_ALIGN_RIGHT_MID, clk_x, 0); + } // Park the async-request spinner just LEFT of the clock wherever it lands, // so it never paints over the clock (incl. the centred hide-name mode). if (g_statusbar.async_icon)