From 182231deebb331da6184c9d11ce4068e7175ac19 Mon Sep 17 00:00:00 2001 From: pelgraine <140762863+pelgraine@users.noreply.github.com> Date: Thu, 12 Mar 2026 16:52:09 +1100 Subject: [PATCH] home ui icons t5s3; repeater path view tap method --- examples/companion_radio/main.cpp | 14 ++++++ .../companion_radio/ui-new/ChannelScreen.h | 3 ++ .../companion_radio/ui-new/Settingsscreen.h | 35 ++++++++++--- examples/companion_radio/ui-new/UITask.cpp | 22 +++++---- examples/companion_radio/ui-new/homeicons.h | 49 +++++++++++++++++++ 5 files changed, 106 insertions(+), 17 deletions(-) create mode 100644 examples/companion_radio/ui-new/homeicons.h diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index ff79d27..9015bd8 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -567,6 +567,20 @@ MyMesh the_mesh(radio_driver, fast_rng, rtc_clock, tables, store } } + // Channel screen: tap footer area → hop path, tap elsewhere → no action + if (ui_task.isOnChannelScreen()) { + int vy = (int)(y / 4.21875f); + ChannelScreen* chScr = (ChannelScreen*)ui_task.getChannelScreen(); + if (chScr && chScr->isShowingPathOverlay()) { + return 'q'; // Dismiss overlay on any tap + } + // Footer zone: bottom ~15 virtual units (≈63 physical pixels) + if (vy >= 113) { + return 'v'; // Show path overlay + } + return 0; // Tap on message area — consumed, no action + } + // All other screens: tap = select return KEY_ENTER; } diff --git a/examples/companion_radio/ui-new/ChannelScreen.h b/examples/companion_radio/ui-new/ChannelScreen.h index 85c7968..b8d84f1 100644 --- a/examples/companion_radio/ui-new/ChannelScreen.h +++ b/examples/companion_radio/ui-new/ChannelScreen.h @@ -969,6 +969,9 @@ public: #if defined(LilyGo_T5S3_EPaper_Pro) display.setCursor(0, footerY); display.print("Swipe:Ch/Scroll"); + const char* midCh = "Tap:Path"; + display.setCursor((display.width() - display.getTextWidth(midCh)) / 2, footerY); + display.print(midCh); const char* rtCh = "Hold:Compose"; display.setCursor(display.width() - display.getTextWidth(rtCh) - 2, footerY); display.print(rtCh); diff --git a/examples/companion_radio/ui-new/Settingsscreen.h b/examples/companion_radio/ui-new/Settingsscreen.h index 86188da..5cc2f38 100644 --- a/examples/companion_radio/ui-new/Settingsscreen.h +++ b/examples/companion_radio/ui-new/Settingsscreen.h @@ -1006,25 +1006,44 @@ public: display.setCursor(0, footerY); #if defined(LilyGo_T5S3_EPaper_Pro) - display.setTextSize(0); if (_editMode == EDIT_NONE) { - display.drawTextCentered(display.width() / 2, footerY, "Swipe: Scroll Tap: Select Hold: Edit boot: home"); + display.print("Swipe:Scroll"); + const char* r = "Tap:Toggle Hold:Edit"; + display.setCursor(display.width() - display.getTextWidth(r) - 2, footerY); + display.print(r); } else if (_editMode == EDIT_NUMBER) { - display.drawTextCentered(display.width() / 2, footerY, "Swipe Up/Down: Adjust Tap: OK boot: cancel"); + display.print("Swipe:Adjust"); + const char* r = "Tap:OK Boot:Cancel"; + display.setCursor(display.width() - display.getTextWidth(r) - 2, footerY); + display.print(r); } else if (_editMode == EDIT_PICKER) { - display.drawTextCentered(display.width() / 2, footerY, "Swipe Left/Right: Choose Tap: OK"); + display.print("Swipe:Choose"); + const char* r = "Tap:OK Boot:Cancel"; + display.setCursor(display.width() - display.getTextWidth(r) - 2, footerY); + display.print(r); } else if (_editMode == EDIT_CONFIRM) { - display.drawTextCentered(display.width() / 2, footerY, "Tap: Confirm boot: cancel"); + display.print("Boot:Cancel"); + const char* r = "Tap:Confirm"; + display.setCursor(display.width() - display.getTextWidth(r) - 2, footerY); + display.print(r); #ifdef MECK_WIFI_COMPANION } else if (_editMode == EDIT_WIFI) { if (_wifiPhase == WIFI_PHASE_SELECT) { - display.drawTextCentered(display.width() / 2, footerY, "Swipe: Pick Tap: Select boot: back"); + display.print("Swipe:Pick"); + const char* r = "Tap:Select Boot:Back"; + display.setCursor(display.width() - display.getTextWidth(r) - 2, footerY); + display.print(r); } else { - display.drawTextCentered(display.width() / 2, footerY, "Please wait..."); + display.print("Please wait..."); } #endif + } else if (_editMode == EDIT_TEXT) { + display.print("Hold:Type"); + const char* r = "Tap:OK Boot:Cancel"; + display.setCursor(display.width() - display.getTextWidth(r) - 2, footerY); + display.print(r); } else { - display.drawTextCentered(display.width() / 2, footerY, "Editing..."); + display.print("Editing..."); } #else if (_editMode == EDIT_TEXT) { diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 56fb40c..7a75628 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -8,6 +8,9 @@ #include "MapScreen.h" #endif #include "target.h" +#if defined(LilyGo_T5S3_EPaper_Pro) + #include "HomeIcons.h" +#endif #if defined(WIFI_SSID) || defined(MECK_WIFI_COMPANION) #include #endif @@ -371,16 +374,16 @@ public: // 3×2 grid of tiles below MSG count // Virtual coords (128×128), scaled by DisplayDriver { - struct Tile { const char* letter; const char* label; }; + struct Tile { const uint8_t* icon; const char* label; }; const Tile tiles[2][3] = { - { {"M", "Messages"}, {"C", "Contacts"}, {"S", "Settings"} }, - { {"E", "Reader"}, {"N", "Notes"}, {"D", "Discover"} } + { {icon_envelope, "Messages"}, {icon_people, "Contacts"}, {icon_gear, "Settings"} }, + { {icon_book, "Reader"}, {icon_notepad, "Notes"}, {icon_search, "Discover"} } }; const int tileW = 40; - const int tileH = 28; // Reduced from 32 to fit with Connected text + const int tileH = 28; const int gapX = 1; - const int gapY = 1; // Reduced from 2 + const int gapY = 1; const int gridW = tileW * 3 + gapX * 2; const int gridX = (display.width() - gridW) / 2; const int gridY = y + 2; @@ -395,11 +398,12 @@ public: display.setColor(DisplayDriver::LIGHT); display.drawRect(tx, ty, tileW, tileH); - // Letter centered in tile (pushed down for vertical centering) - display.setTextSize(2); - display.drawTextCentered(tx + tileW / 2, ty + 8, tiles[row][col].letter); + // Icon centered in tile + int iconX = tx + (tileW - HOME_ICON_W) / 2; + int iconY = ty + 4; + display.drawXbm(iconX, iconY, tiles[row][col].icon, HOME_ICON_W, HOME_ICON_H); - // Label centered below letter + // Label centered below icon display.setTextSize(0); display.drawTextCentered(tx + tileW / 2, ty + 18, tiles[row][col].label); } diff --git a/examples/companion_radio/ui-new/homeicons.h b/examples/companion_radio/ui-new/homeicons.h new file mode 100644 index 0000000..806eb93 --- /dev/null +++ b/examples/companion_radio/ui-new/homeicons.h @@ -0,0 +1,49 @@ +#pragma once +// ============================================================================= +// HomeIcons — 12x12 icon sprites for T5S3 home screen tiles +// MSB-first, 2 bytes per row (same format as emoji sprites) +// ============================================================================= + +#include +#ifdef ESP32 +#include +#endif + +#define HOME_ICON_W 12 +#define HOME_ICON_H 12 + +// ✉️ Envelope (Messages) +static const uint8_t icon_envelope[] PROGMEM = { + 0xFF,0xF0, 0x80,0x10, 0xC0,0x30, 0xA0,0x50, 0x90,0x90, 0x89,0x10, + 0x86,0x10, 0x80,0x10, 0x80,0x10, 0x80,0x10, 0x80,0x10, 0xFF,0xF0, +}; + +// 👥 People (Contacts) +static const uint8_t icon_people[] PROGMEM = { + 0x31,0x80, 0x7B,0xC0, 0x7B,0xC0, 0x31,0x80, 0x00,0x00, 0x7B,0xC0, + 0xFD,0xE0, 0xFD,0xE0, 0x7B,0xC0, 0x00,0x00, 0x00,0x00, 0x00,0x00, +}; + +// 🎚 Sliders (Settings) +static const uint8_t icon_gear[] PROGMEM = { + 0x22,0x20, 0x22,0x20, 0x72,0x70, 0x72,0x70, 0x27,0x20, 0x27,0x20, + 0x22,0x20, 0x72,0x20, 0x72,0x70, 0x22,0x70, 0x22,0x20, 0x22,0x20, +}; + +// 📖 Book (Reader) +static const uint8_t icon_book[] PROGMEM = { + 0x7F,0xC0, 0x41,0x40, 0x5D,0x40, 0x5D,0x40, 0x41,0x40, 0x5D,0x40, + 0x5D,0x40, 0x41,0x40, 0x5D,0x40, 0x41,0x40, 0x7F,0xC0, 0x00,0x00, +}; + +// 🗒 Notepad (Notes) +static const uint8_t icon_notepad[] PROGMEM = { + 0x3F,0xC0, 0x20,0x40, 0x2F,0x40, 0x20,0x40, 0x2F,0x40, 0x20,0x40, + 0x2F,0x40, 0x20,0x40, 0x2F,0x40, 0x20,0x40, 0x3F,0xC0, 0x00,0x00, +}; + +// 🔍 Magnifying glass (Discover) +static const uint8_t icon_search[] PROGMEM = { + 0x3C,0x00, 0x42,0x00, 0x81,0x00, 0x81,0x00, 0x81,0x00, 0x42,0x00, + 0x3C,0x00, 0x03,0x00, 0x01,0x80, 0x00,0xC0, 0x00,0x40, 0x00,0x00, +}; \ No newline at end of file