MenuDisplayWithTime now supports font size

This commit is contained in:
CommanderRedYT
2021-12-14 21:52:34 +01:00
parent b59d9dff9f
commit 5903fc21b1
2 changed files with 11 additions and 1 deletions

View File

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

View File

@ -1,6 +1,7 @@
#pragma once
#include <menudisplay.h>
#include <cstdint>
namespace bobbygui {
class MenuDisplayWithTime :
@ -11,5 +12,14 @@ public:
void start() override;
void redraw() override;
espgui::Label m_label_currentTime{145, 6};
private:
virtual bool m_use_big_font() const
{
#ifdef MENU_DISPLAY_USE_BIG_TIME
return true;
#else
return false;
#endif
}
};
} // namespace