Files
klubhaus-doorbell/sketches/doorbell-touch/boards/esp32-32e/DisplayDriverTFT.h
David Gwilliam 8c92487a47 refactor: add active parameter to updateHint method signature
1. **Method Signature Update**: Added `bool active` parameter to `updateHint()` method across the display driver hierarchy:
   - `DisplayManager::updateHint(x, y, active)` - delegates to driver
   - `DisplayDriverTFT::updateHint(x, y, active)` - override implementation
   - `DisplayDriverGFX::updateHint(x, y, active)` - override implementation

2. **Code Formatting**: `DisplayManager.h` reformatted (whitespace/comment style changes only)

- **Breaking Change**: All existing `updateHint(x, y)` calls will fail to compile until updated to include the `active` parameter
- **Enhanced Control**: Callers can now explicitly show/hide touch hints rather than just updating position, enabling better touch feedback UX (e.g., hide hint on touch release)
- **API Consistency**: All implementations in the driver hierarchy now enforce the same signature
2026-02-17 05:23:43 -08:00

32 lines
848 B
C++

#pragma once
#include "board_config.h"
#include <KlubhausCore.h>
#include <TFT_eSPI.h>
class DisplayDriverTFT : public IDisplayDriver {
public:
void begin() override;
void setBacklight(bool on) override;
void render(const ScreenState& state) override;
TouchEvent readTouch() override;
int dashboardTouch(int x, int y) override;
HoldState updateHold(unsigned long holdMs) override;
void updateHint(int x, int y, bool active) override;
int width() override { return DISPLAY_WIDTH; }
int height() override { return DISPLAY_HEIGHT; }
private:
void drawBoot();
void drawAlert(const ScreenState& st);
void drawDashboard(const ScreenState& st);
TFT_eSPI _tft;
bool _holdActive = false;
uint32_t _holdStartMs = 0;
ScreenID _lastScreen = ScreenID::BOOT;
bool _needsRedraw = true;
};