feat(boards): add device detection and text scrolling support

This commit is contained in:
2026-02-19 21:46:33 -08:00
parent 913373ca72
commit 66f09c3468
12 changed files with 290 additions and 11 deletions

View File

@@ -395,16 +395,37 @@ void DisplayDriverGFX::drawAlert(const ScreenState& state) {
void DisplayDriverGFX::drawDashboard(const ScreenState& state) {
_gfx->fillScreen(STYLE_COLOR_BG);
// Header
// Header - use Layout for safe positioning
_gfx->fillRect(0, 0, DISP_W, STYLE_HEADER_HEIGHT, STYLE_COLOR_HEADER);
Layout header = Layout::header(DISP_W, STYLE_HEADER_HEIGHT);
Layout safeText = header.padded(STYLE_SPACING_X);
setBodyFont();
_gfx->setTextColor(STYLE_COLOR_FG);
_gfx->setCursor(STYLE_SPACING_X, 12);
_gfx->printf("KLUBHAUS");
// WiFi status
_gfx->setCursor(DISP_W - 120, 12);
_gfx->printf("WiFi:%s", state.wifiSsid.length() > 0 ? "ON" : "OFF");
// Title with scrolling support
_headerScroller.setText("KLUBHAUS");
_headerScroller.setScrollSpeed(80);
_headerScroller.setPauseDuration(2000);
_headerScroller.render(
[&](int16_t x, const char* s) {
_gfx->setCursor(safeText.x + x, safeText.y + 4);
_gfx->print(s);
},
safeText.w);
// WiFi status - right aligned with scrolling
Layout wifiArea(DISP_W - 150, 0, 140, STYLE_HEADER_HEIGHT);
Layout safeWifi = wifiArea.padded(4);
_wifiScroller.setText(state.wifiSsid.length() > 0 ? state.wifiSsid.c_str() : "WiFi: OFF");
_wifiScroller.setScrollSpeed(60);
_wifiScroller.setPauseDuration(1500);
_wifiScroller.render(
[&](int16_t x, const char* s) {
_gfx->setCursor(safeWifi.x + x, safeWifi.y + 4);
_gfx->print(s);
},
safeWifi.w);
// Get tile layouts from library helper
int tileCount = display.calculateDashboardLayouts(STYLE_HEADER_HEIGHT, STYLE_TILE_GAP);