From 068ef657e8443e15252e5db846e084fd8d592c09 Mon Sep 17 00:00:00 2001 From: Florian Wetzel Date: Thu, 20 Feb 2025 16:11:05 +0100 Subject: [PATCH] Expose title dimensions as variables --- src/displaywithtitle.cpp | 2 +- src/displaywithtitle.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/displaywithtitle.cpp b/src/displaywithtitle.cpp index 59a1d1a..0a750b6 100644 --- a/src/displaywithtitle.cpp +++ b/src/displaywithtitle.cpp @@ -14,7 +14,7 @@ void DisplayWithTitle::initScreen(TftInterface &tft) // tft.fillRect(0, 0, tft.width(), 35, TFT_GREY); - tft.fillRect(0, 34, tft.width(), 2, TFT_GREY); + tft.fillRect(0, TITLE_HEIGHT, tft.width(), TITLE_BORDER, TFT_GREY); } void DisplayWithTitle::redraw(TftInterface &tft) diff --git a/src/displaywithtitle.h b/src/displaywithtitle.h index ebc4feb..1f0f494 100644 --- a/src/displaywithtitle.h +++ b/src/displaywithtitle.h @@ -14,6 +14,9 @@ class DisplayWithTitle : using Base = Display; public: + constexpr static int TITLE_HEIGHT = 34; + constexpr static int TITLE_BORDER = 2; + TitleInterface *asTitleInterface() override { return this; } const TitleInterface *asTitleInterface() const override { return this; }