refactor(display): split render into screen-specific draw methods

This commit is contained in:
2026-02-17 00:06:30 -08:00
parent 9f0e603215
commit 66b4e75174
4 changed files with 144 additions and 86 deletions

View File

@@ -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;
};