snapshot
This commit is contained in:
@@ -3,6 +3,16 @@
|
||||
#include "ScreenData.h"
|
||||
#include "Dashboard.h"
|
||||
|
||||
// Hold gesture result
|
||||
struct HoldState {
|
||||
bool active = false; // finger currently down
|
||||
bool completed = false; // hold duration met
|
||||
uint16_t x = 0;
|
||||
uint16_t y = 0;
|
||||
unsigned long holdMs = 0; // how long held so far
|
||||
unsigned long targetMs = 0; // required hold duration
|
||||
};
|
||||
|
||||
class DisplayManager {
|
||||
public:
|
||||
DisplayManager();
|
||||
@@ -14,16 +24,27 @@ public:
|
||||
// Dashboard tile touch — returns TileID or -1
|
||||
int dashboardTouch(uint16_t x, uint16_t y);
|
||||
|
||||
private:
|
||||
TFT_eSPI _tft;
|
||||
Dashboard _dash;
|
||||
// Hold detection — call each loop iteration
|
||||
HoldState updateHold(unsigned long requiredMs);
|
||||
|
||||
ScreenID _lastScreen = ScreenID::BOOT_SPLASH;
|
||||
bool _needsFullRedraw = true;
|
||||
bool _lastBlink = false;
|
||||
bool _dashSpriteReady = false;
|
||||
// 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;
|
||||
unsigned long _lastDashRefresh = 0;
|
||||
|
||||
// Hold tracking state
|
||||
bool _holdActive = false;
|
||||
unsigned long _holdStartMs = 0;
|
||||
uint16_t _holdX = 0;
|
||||
uint16_t _holdY = 0;
|
||||
|
||||
// Colors
|
||||
static constexpr uint16_t COL_NEON_TEAL = 0x07D7;
|
||||
static constexpr uint16_t COL_HOT_FUCHSIA = 0xF81F;
|
||||
|
||||
Reference in New Issue
Block a user