Cleanup unused LvglWidgetFactory
This commit is contained in:
committed by
Raphael Coeffic
parent
c0e6b2c567
commit
ec2c5c5bdc
@@ -25,38 +25,11 @@
|
|||||||
#include <lvgl/lvgl.h>
|
#include <lvgl/lvgl.h>
|
||||||
#include "opentx_types.h"
|
#include "opentx_types.h"
|
||||||
|
|
||||||
|
void initLvglTheme();
|
||||||
|
|
||||||
lv_color_t makeLvColor(uint32_t colorFlags);
|
lv_color_t makeLvColor(uint32_t colorFlags);
|
||||||
|
|
||||||
class LvglWidgetFactory;
|
|
||||||
typedef std::function<lv_obj_t *(lv_obj_t *parent)> LvObjConstructor;
|
typedef std::function<lv_obj_t *(lv_obj_t *parent)> LvObjConstructor;
|
||||||
typedef std::function<void (LvglWidgetFactory *factory)> 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
|
class LvglWrapper
|
||||||
{
|
{
|
||||||
@@ -80,6 +53,4 @@ class LvglWrapper
|
|||||||
static void runNested();
|
static void runNested();
|
||||||
};
|
};
|
||||||
|
|
||||||
void initLvglTheme();
|
|
||||||
|
|
||||||
#endif // _LVGLWRAPPER_H_
|
#endif // _LVGLWRAPPER_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user