diff --git a/radio/src/gui/colorlcd/LvglWrapper.h b/radio/src/gui/colorlcd/LvglWrapper.h index 1b79adc2f..fbfc233ac 100644 --- a/radio/src/gui/colorlcd/LvglWrapper.h +++ b/radio/src/gui/colorlcd/LvglWrapper.h @@ -25,38 +25,11 @@ #include #include "opentx_types.h" +void initLvglTheme(); + lv_color_t makeLvColor(uint32_t colorFlags); -class LvglWidgetFactory; typedef std::function LvObjConstructor; -typedef std::function LvStyleInitializer; - -class LvglWidgetFactory -{ - public: - LvglWidgetFactory(LvObjConstructor construct, LvStyleInitializer styleInitializer = nullptr) : - _construct(std::move(construct)), - _styleInitializer(std::move(styleInitializer)) - { - lv_style_init(&style); - styleInitialized = false; - }; - - lv_style_t style; - - inline lv_obj_t *construct(lv_obj_t *parent) { - if (!styleInitialized && _styleInitializer != nullptr) { - (_styleInitializer(this)); - styleInitialized = true; - } - return _construct(parent); - } - - private: - LvObjConstructor _construct; - LvStyleInitializer _styleInitializer; - bool styleInitialized; -}; class LvglWrapper { @@ -80,6 +53,4 @@ class LvglWrapper static void runNested(); }; -void initLvglTheme(); - #endif // _LVGLWRAPPER_H_