This commit is contained in:
2026-02-16 03:14:38 -08:00
parent 67fd36bffb
commit 893c50dbc0
7 changed files with 255 additions and 304 deletions

View File

@@ -3,14 +3,13 @@
#include "ScreenData.h"
#include "Dashboard.h"
// Hold gesture result
struct HoldState {
bool active = false; // finger currently down
bool completed = false; // hold duration met
bool active = false;
bool completed = false;
uint16_t x = 0;
uint16_t y = 0;
unsigned long holdMs = 0; // how long held so far
unsigned long targetMs = 0; // required hold duration
unsigned long holdMs = 0;
unsigned long targetMs = 0;
};
class DisplayManager {
@@ -21,29 +20,25 @@ public:
void setBacklight(bool on);
TouchEvent readTouch();
// Dashboard tile touch — returns TileID or -1
int dashboardTouch(uint16_t x, uint16_t y);
// Hold detection — call each loop iteration
int dashboardTouch(uint16_t x, uint16_t y);
HoldState updateHold(unsigned long requiredMs);
// Draw hold-to-silence progress bar on alert screen
void drawSilenceProgress(float progress);
private:
TFT_eSPI _tft;
Dashboard _dash;
ScreenID _lastScreen = ScreenID::BOOT_SPLASH;
bool _needsFullRedraw = true;
bool _lastBlink = false;
bool _dashSpriteReady = false;
ScreenID _lastScreen = ScreenID::BOOT_SPLASH;
bool _needsFullRedraw = true;
bool _lastBlink = false;
bool _dashSpriteReady = false;
unsigned long _lastDashRefresh = 0;
// Hold tracking state
bool _holdActive = false;
unsigned long _holdStartMs = 0;
uint16_t _holdX = 0;
uint16_t _holdY = 0;
// Hold tracking
bool _holdActive = false;
unsigned long _holdStartMs = 0;
uint16_t _holdX = 0;
uint16_t _holdY = 0;
float _holdProgress = 0.0f;
// Colors
static constexpr uint16_t COL_NEON_TEAL = 0x07D7;
@@ -64,6 +59,7 @@ private:
void drawAlertScreen(const ScreenState& s);
void drawStatusScreen(const ScreenState& s);
void drawDashboard(const ScreenState& s);
void drawSilenceProgress(float progress);
// Helpers
void drawCentered(const char* txt, int y, int sz, uint16_t col);