From 40233604cea1dce77a49d793ccd2c1a885e10376 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Tue, 31 May 2022 10:26:58 +0200 Subject: [PATCH] cleanup & formatting --- radio/src/thirdparty/libopenui/src/static.h | 30 ++++++++++----------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/static.h b/radio/src/thirdparty/libopenui/src/static.h index 1659dd7d4..4912b2e6d 100644 --- a/radio/src/thirdparty/libopenui/src/static.h +++ b/radio/src/thirdparty/libopenui/src/static.h @@ -130,27 +130,25 @@ class StaticBitmap: public Window bool scale = false; }; -class DynamicText: public StaticText +class DynamicText : public StaticText { - public: - DynamicText(Window * parent, const rect_t & rect, std::function textHandler, LcdFlags textFlags = 0): + public: + DynamicText(Window *parent, const rect_t &rect, + std::function textHandler, + LcdFlags textFlags = 0) : StaticText(parent, rect, "", 0, textFlags), textHandler(std::move(textHandler)) - { - } + { + } - void checkEvents() override - { - StaticText::checkEvents(); - std::string newText = textHandler(); - if (newText != text) { - setText(newText); - invalidate(); - } - } + void checkEvents() override + { + StaticText::checkEvents(); + setText(textHandler()); + } - protected: - std::function textHandler; + protected: + std::function textHandler; }; template