refactor(display): extract dashboard tile grid logic to DisplayManager

This commit is contained in:
2026-02-18 04:28:35 -08:00
parent 3b8e54c511
commit 67613120ad
10 changed files with 259 additions and 64 deletions

View File

@@ -96,6 +96,22 @@ int DisplayDriverGFX::dashboardTouch(int x, int y) {
return row * cols + col;
}
void DisplayDriverGFX::drawTileAt(int x, int y, int w, int h, const char* label, uint16_t bgColor) {
// Tile background (use fillRect - LovyanGFX may not have fillRoundRect)
_gfx->fillRect(x, y, w, h, bgColor);
// Tile border
_gfx->drawRect(x, y, w, h, 0xFFFF);
// Tile label
_gfx->setTextColor(0xFFFF);
_gfx->setTextSize(2);
int textLen = strlen(label);
int textW = textLen * 12;
_gfx->setCursor(x + w/2 - textW/2, y + h/2 - 10);
_gfx->print(label);
}
HoldState DisplayDriverGFX::updateHold(unsigned long holdMs) {
HoldState state;