button: Window parent instead of FormGroup

This commit is contained in:
Raphael Coeffic
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent fc705d5d0b
commit 40268f8e52
2 changed files with 8 additions and 9 deletions
+2 -4
View File
@@ -31,7 +31,7 @@ static void lvglEvent(lv_event_t* e)
btn->onEvent(e);
}
Button::Button(FormGroup* parent, const rect_t& rect,
Button::Button(Window* parent, const rect_t& rect,
std::function<uint8_t(void)> pressHandler,
WindowFlags windowFlag, LcdFlags textFlags,
LvglCreate objConstruct) :
@@ -101,9 +101,7 @@ void Button::checkEvents()
checkHandler();
}
lv_style_t style_btn;
TextButton::TextButton(FormGroup* parent, const rect_t& rect, std::string text,
TextButton::TextButton(Window* parent, const rect_t& rect, std::string text,
std::function<uint8_t(void)> pressHandler,
WindowFlags windowFlags, LcdFlags textFlags) :
Button(parent, rect, std::move(pressHandler), windowFlags, textFlags,
+6 -5
View File
@@ -28,7 +28,7 @@ constexpr WindowFlags BUTTON_CHECKED_ON_FOCUS = FORM_FLAGS_LAST << 3u;
class Button: public FormField
{
public:
Button(FormGroup* parent, const rect_t& rect,
Button(Window* parent, const rect_t& rect,
std::function<uint8_t(void)> pressHandler = nullptr,
WindowFlags windowFlags = 0, LcdFlags textFlags = 0,
LvglCreate objConstruct = nullptr);
@@ -88,7 +88,7 @@ class Button: public FormField
class TextButton: public Button
{
public:
TextButton(FormGroup* parent, const rect_t& rect, std::string text,
TextButton(Window* parent, const rect_t& rect, std::string text,
std::function<uint8_t(void)> pressHandler = nullptr,
WindowFlags windowFlags = BUTTON_BACKGROUND | OPAQUE,
LcdFlags textFlags = 0);
@@ -123,9 +123,10 @@ class TextButton: public Button
class IconButton: public Button
{
public:
IconButton(FormGroup * parent, const rect_t & rect, uint8_t icon, std::function<uint8_t(void)> pressHandler, WindowFlags flags = 0):
Button(parent, rect, std::move(pressHandler), flags),
icon(icon)
IconButton(Window* parent, const rect_t& rect, uint8_t icon,
std::function<uint8_t(void)> pressHandler,
WindowFlags flags = 0) :
Button(parent, rect, std::move(pressHandler), flags), icon(icon)
{
}