From 148fb7f001f53cfd193b4c751ef9e5ec90ec9b2d Mon Sep 17 00:00:00 2001 From: pelgraine <140762863+pelgraine@users.noreply.github.com> Date: Sat, 14 Mar 2026 15:36:40 +1100 Subject: [PATCH] t5s3 minor ui settings screen channel delete fixes --- examples/companion_radio/main.cpp | 11 ++++++++++- examples/companion_radio/ui-new/Settingsscreen.h | 15 +++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index 260ca53..aac3d9a 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -832,7 +832,16 @@ MyMesh the_mesh(radio_driver, fast_rng, rtc_clock, tables, store } } - // Default: enter/select (settings toggle, etc.) + // Settings screen: long press on a deletable channel → trigger delete + if (ui_task.isOnSettingsScreen()) { + SettingsScreen* ss = (SettingsScreen*)ui_task.getSettingsScreen(); + if (ss && ss->isCursorOnDeletableChannel()) { + return 'x'; // Triggers existing X key → EDIT_CONFIRM delete flow + } + return KEY_ENTER; // All other settings rows: toggle/edit as normal + } + + // Default: enter/select return KEY_ENTER; } #endif diff --git a/examples/companion_radio/ui-new/Settingsscreen.h b/examples/companion_radio/ui-new/Settingsscreen.h index a88d4c3..4f6eb45 100644 --- a/examples/companion_radio/ui-new/Settingsscreen.h +++ b/examples/companion_radio/ui-new/Settingsscreen.h @@ -477,6 +477,13 @@ public: bool isEditing() const { return _editMode != EDIT_NONE; } bool hasRadioChanges() const { return _radioChanged; } + // Returns true when cursor is on a non-public channel row (deletable) + bool isCursorOnDeletableChannel() const { + if (_cursor < 0 || _cursor >= _numRows) return false; + return _rows[_cursor].type == ROW_CHANNEL && _rows[_cursor].param > 0 + && _editMode == EDIT_NONE; + } + // --------------------------------------------------------------------------- // WiFi scan helpers // --------------------------------------------------------------------------- @@ -881,7 +888,11 @@ public: snprintf(tmp, sizeof(tmp), " %s", ch.name); if (selected) { // Show delete hint on right +#if defined(LilyGo_T5S3_EPaper_Pro) + const char* hint = "Hold:Delete"; +#else const char* hint = "Del:X"; +#endif int hintW = display.getTextWidth(hint); display.setCursor(display.width() - hintW - 2, y); display.print(hint); @@ -995,7 +1006,11 @@ public: } else if (_confirmAction == 2) { display.drawTextCentered(display.width() / 2, by + 4, "Apply radio changes?"); } +#if defined(LilyGo_T5S3_EPaper_Pro) + display.drawTextCentered(display.width() / 2, by + bh - 14, "Tap:Yes Boot:No"); +#else display.drawTextCentered(display.width() / 2, by + bh - 14, "Enter:Yes Q:No"); +#endif display.setTextSize(1); }