This commit is contained in:
2021-12-18 16:45:58 +01:00
parent 023986b827
commit abb76a29b9
2 changed files with 7 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ void MenuDisplayWithTime::start()
void MenuDisplayWithTime::redraw() void MenuDisplayWithTime::redraw()
{ {
Base::redraw(); Base::redraw();
tft.setTextFont(m_use_big_font() ? 4 : 2); tft.setTextFont(use_big_font() ? 4 : 2);
m_label_currentTime.redraw(fmt::format("&7Time: {}", local_clock_string())); m_label_currentTime.redraw(fmt::format("&7Time: {}", local_clock_string()));
} }

View File

@@ -1,11 +1,14 @@
#pragma once #pragma once
#include <menudisplay.h> // system includes
#include <cstdint> #include <cstdint>
// 3rdparty lib includes
#include <menudisplay.h>
namespace bobbygui { namespace bobbygui {
class MenuDisplayWithTime : class MenuDisplayWithTime :
public espgui::MenuDisplay public espgui::MenuDisplay
{ {
using Base = espgui::MenuDisplay; using Base = espgui::MenuDisplay;
public: public:
@@ -13,7 +16,7 @@ public:
void redraw() override; void redraw() override;
espgui::Label m_label_currentTime{145, 6}; espgui::Label m_label_currentTime{145, 6};
private: private:
virtual bool m_use_big_font() const virtual bool use_big_font() const
{ {
#ifdef MENU_DISPLAY_USE_BIG_TIME #ifdef MENU_DISPLAY_USE_BIG_TIME
return true; return true;