cleanup & formatting

This commit is contained in:
Raphael Coeffic
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent fd0881f19e
commit 40233604ce
+4 -6
View File
@@ -133,7 +133,9 @@ class StaticBitmap: public Window
class DynamicText : public StaticText class DynamicText : public StaticText
{ {
public: public:
DynamicText(Window * parent, const rect_t & rect, std::function<std::string()> textHandler, LcdFlags textFlags = 0): DynamicText(Window *parent, const rect_t &rect,
std::function<std::string()> textHandler,
LcdFlags textFlags = 0) :
StaticText(parent, rect, "", 0, textFlags), StaticText(parent, rect, "", 0, textFlags),
textHandler(std::move(textHandler)) textHandler(std::move(textHandler))
{ {
@@ -142,11 +144,7 @@ class DynamicText: public StaticText
void checkEvents() override void checkEvents() override
{ {
StaticText::checkEvents(); StaticText::checkEvents();
std::string newText = textHandler(); setText(textHandler());
if (newText != text) {
setText(newText);
invalidate();
}
} }
protected: protected: