feat: add debug touch drawing function and fix dashboard layout calculations

This commit is contained in:
2026-02-19 17:48:39 -08:00
parent a3164d722e
commit 4da32466a8
6 changed files with 13 additions and 4 deletions

View File

@@ -221,7 +221,7 @@ void DisplayDriverTFT::drawDashboard(const ScreenState& st) {
_tft.print(st.wifiSsid.length() > 0 ? "WiFi:ON" : "WiFi:OFF"); _tft.print(st.wifiSsid.length() > 0 ? "WiFi:ON" : "WiFi:OFF");
// Get tile layouts from library helper // Get tile layouts from library helper
int tileCount = display.calculateDashboardLayouts(30, 8); int tileCount = display.calculateDashboardLayouts(STYLE_HEADER_HEIGHT, STYLE_TILE_GAP);
const TileLayout* layouts = display.getTileLayouts(); const TileLayout* layouts = display.getTileLayouts();
const char* tileLabels[] = { "Alert", "Silent", "Status", "Reboot" }; const char* tileLabels[] = { "Alert", "Silent", "Status", "Reboot" };

View File

@@ -326,3 +326,9 @@ HoldState DisplayDriverTFT::updateHold(unsigned long holdMs) {
} }
return h; return h;
} }
void DisplayDriverTFT::drawDebugTouch(int x, int y) {
const int size = 20;
_tft.drawLine(x - size, y, x + size, y, TFT_RED);
_tft.drawLine(x, y - size, x, y + size, TFT_RED);
}

View File

@@ -22,6 +22,9 @@ public:
void setLabelFont() override; void setLabelFont() override;
void setDefaultFont() override; void setDefaultFont() override;
// Debug
void drawDebugTouch(int x, int y) override;
private: private:
void drawBoot(const ScreenState& st); void drawBoot(const ScreenState& st);
void drawAlert(const ScreenState& st); void drawAlert(const ScreenState& st);

View File

@@ -407,7 +407,7 @@ void DisplayDriverGFX::drawDashboard(const ScreenState& state) {
_gfx->printf("WiFi:%s", state.wifiSsid.length() > 0 ? "ON" : "OFF"); _gfx->printf("WiFi:%s", state.wifiSsid.length() > 0 ? "ON" : "OFF");
// Get tile layouts from library helper // Get tile layouts from library helper
int tileCount = display.calculateDashboardLayouts(30, 8); int tileCount = display.calculateDashboardLayouts(STYLE_HEADER_HEIGHT, STYLE_TILE_GAP);
const TileLayout* layouts = display.getTileLayouts(); const TileLayout* layouts = display.getTileLayouts();
const char* tileLabels[] = { "1", "2", "3", "4", "5", "6", "7", "8" }; const char* tileLabels[] = { "1", "2", "3", "4", "5", "6", "7", "8" };

View File

@@ -43,7 +43,7 @@
// Spacing // Spacing
#define STYLE_SPACING_X 10 #define STYLE_SPACING_X 10
#define STYLE_SPACING_Y 10 #define STYLE_SPACING_Y 10
#define STYLE_HEADER_HEIGHT 40 #define STYLE_HEADER_HEIGHT 45
#define STYLE_TILE_GAP 8 #define STYLE_TILE_GAP 8
#define STYLE_TILE_PADDING 16 #define STYLE_TILE_PADDING 16
#define STYLE_TILE_RADIUS 8 #define STYLE_TILE_RADIUS 8

View File

@@ -215,4 +215,4 @@ echo "[OK] Generated .crush.json with FQBN: $FQBN"
run = "git add .; lumen draft | git commit -F - " run = "git add .; lumen draft | git commit -F - "
[env] [env]
BOARD = "esp32-s3-lcd-43" BOARD = "esp32-32e-4"