mirror of
https://github.com/pelgraine/Meck.git
synced 2026-03-28 17:42:44 +01:00
home ui icons t5s3; repeater path view tap method
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 <WiFi.h>
|
||||
#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);
|
||||
}
|
||||
|
||||
49
examples/companion_radio/ui-new/homeicons.h
Normal file
49
examples/companion_radio/ui-new/homeicons.h
Normal file
@@ -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 <stdint.h>
|
||||
#ifdef ESP32
|
||||
#include <pgmspace.h>
|
||||
#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,
|
||||
};
|
||||
Reference in New Issue
Block a user