Skip to content

Commit

Permalink
introduce LVObj in the wrong header file
Browse files Browse the repository at this point in the history
  • Loading branch information
Habbie committed Mar 11, 2024
1 parent 318f53b commit 2054de7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/uicomponents/uirgblight.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
#include <src/core/lv_event.h>
#include <src/draw/lv_img_buf.h>

class LVObj {
public:
LVObj(lv_obj_t* _obj) : obj{_obj} {};

operator lv_obj_t*() { return obj; };

private:
lv_obj_t* obj{nullptr};
lv_obj_t* parent{nullptr};
};

// lvobj = std::unique_ptr<lv_obj_t, decltype(&lv_obj_del)>;

class UIRGBLight : public UIEntity
{
public:
Expand All @@ -13,7 +26,7 @@ class UIRGBLight : public UIEntity

private:
// FIXME: we never free() the lv_obj_t*'s in code
lv_obj_t* btnOnOff;
LVObj btnOnOff{nullptr};
lv_obj_t* btnBrightness;
lv_obj_t* btnColorWheel;
lv_obj_t* btnColorTemp;
Expand Down

0 comments on commit 2054de7

Please sign in to comment.