refactor(display): split render into screen-specific draw methods
This commit is contained in:
@@ -1,21 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "ScreenState.h"
|
||||
#include "IDisplayDriver.h"
|
||||
|
||||
struct TouchEvent {
|
||||
bool pressed = false;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
};
|
||||
|
||||
struct HoldState {
|
||||
bool active = false;
|
||||
bool completed = false;
|
||||
float progress = 0.0f; // 0.0 – 1.0
|
||||
};
|
||||
|
||||
class DisplayDriverGFX : public IDisplayDriver {
|
||||
public:
|
||||
// ── IDisplayDriver ──
|
||||
@@ -35,8 +22,16 @@ public:
|
||||
static DisplayDriverGFX& instance();
|
||||
|
||||
private:
|
||||
// Helper rendering functions
|
||||
void drawAlert(const ScreenState& state);
|
||||
void drawDashboard(const ScreenState& state);
|
||||
|
||||
// Touch handling
|
||||
TouchEvent _lastTouch = {false, 0, 0};
|
||||
unsigned long _pressStartMs = 0;
|
||||
bool _isHolding = false;
|
||||
|
||||
// Screen tracking
|
||||
ScreenID _lastScreen = ScreenID::BOOT;
|
||||
bool _needsRedraw = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user