MenuDisplayWithTime now supports font size
This commit is contained in:
@ -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()));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user