From 82982002be43d841cd04a09f78c6363837436c9b Mon Sep 17 00:00:00 2001 From: pelgraine <140762863+pelgraine@users.noreply.github.com> Date: Sat, 18 Jul 2026 12:03:41 +1000 Subject: [PATCH] T-Watch - fix touch and ui bugs so that ticker scroll display works for longer text rows, and long press to open rx log --- examples/companion_radio/ui-new/SettingsScreen.h | 4 +++- examples/companion_radio/ui-new/UITask.cpp | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-new/SettingsScreen.h b/examples/companion_radio/ui-new/SettingsScreen.h index 07b7fffe..50a92891 100644 --- a/examples/companion_radio/ui-new/SettingsScreen.h +++ b/examples/companion_radio/ui-new/SettingsScreen.h @@ -2371,7 +2371,9 @@ public: #if defined(MECK_TWATCH) if (selected && tickerPass == 0) { - rowTextW = ((LGFXDisplay*)&display)->getCursorX() - rowStartX; + // getCursorX() is unusable here: LGFXDisplay::print() calls buffer.println(), + // whose newline resets the cursor X to 0. Measure the string directly. + rowTextW = display.getTextWidth(tmp); } } // ticker pass loop if (selected) _tickerTextW = rowTextW; diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 3fe1a43e..f6f1bfcc 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -2689,6 +2689,13 @@ if (curr) curr->poll(); setCurrScreen(watch_channel_cfg_screen); } } + // Touch activates rows via injectKey->handleInput, which bypasses the + // main.cpp key handler that consumes this flag. Consume it here too so a + // watch long-press opens the Rx Log (mirrors wantsWatchChannels above). + if (ss->isRxLogRequested()) { + ss->clearRxLogRequest(); + gotoRxLogScreen(); + } } #endif