feat: add debug touch drawing function and fix dashboard layout calculations
This commit is contained in:
@@ -221,7 +221,7 @@ void DisplayDriverTFT::drawDashboard(const ScreenState& st) {
|
||||
_tft.print(st.wifiSsid.length() > 0 ? "WiFi:ON" : "WiFi:OFF");
|
||||
|
||||
// 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 char* tileLabels[] = { "Alert", "Silent", "Status", "Reboot" };
|
||||
|
||||
@@ -326,3 +326,9 @@ HoldState DisplayDriverTFT::updateHold(unsigned long holdMs) {
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,9 @@ public:
|
||||
void setLabelFont() override;
|
||||
void setDefaultFont() override;
|
||||
|
||||
// Debug
|
||||
void drawDebugTouch(int x, int y) override;
|
||||
|
||||
private:
|
||||
void drawBoot(const ScreenState& st);
|
||||
void drawAlert(const ScreenState& st);
|
||||
|
||||
@@ -407,7 +407,7 @@ void DisplayDriverGFX::drawDashboard(const ScreenState& state) {
|
||||
_gfx->printf("WiFi:%s", state.wifiSsid.length() > 0 ? "ON" : "OFF");
|
||||
|
||||
// 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 char* tileLabels[] = { "1", "2", "3", "4", "5", "6", "7", "8" };
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
// Spacing
|
||||
#define STYLE_SPACING_X 10
|
||||
#define STYLE_SPACING_Y 10
|
||||
#define STYLE_HEADER_HEIGHT 40
|
||||
#define STYLE_HEADER_HEIGHT 45
|
||||
#define STYLE_TILE_GAP 8
|
||||
#define STYLE_TILE_PADDING 16
|
||||
#define STYLE_TILE_RADIUS 8
|
||||
|
||||
Reference in New Issue
Block a user