Do not use lv_obj_create(nullptr)
This commit is contained in:
committed by
Raphael Coeffic
parent
64a834d584
commit
ca5b6a121c
+1
-5
@@ -22,12 +22,8 @@
|
|||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "layer.h"
|
#include "layer.h"
|
||||||
|
|
||||||
LvglWidgetFactory modalFactory = LvglWidgetFactory([] (lv_obj_t *parent) {
|
|
||||||
return lv_obj_create(nullptr);
|
|
||||||
});
|
|
||||||
|
|
||||||
ModalWindow::ModalWindow(Window * parent, bool closeWhenClickOutside):
|
ModalWindow::ModalWindow(Window * parent, bool closeWhenClickOutside):
|
||||||
Window(parent->getFullScreenWindow(), {0, 0, LCD_W, LCD_H}, 0, 0, &modalFactory),
|
Window(parent->getFullScreenWindow(), {0, 0, LCD_W, LCD_H}),
|
||||||
closeWhenClickOutside(closeWhenClickOutside)
|
closeWhenClickOutside(closeWhenClickOutside)
|
||||||
{
|
{
|
||||||
Layer::push(this);
|
Layer::push(this);
|
||||||
|
|||||||
+2
-2
@@ -118,7 +118,8 @@ LvglWidgetFactory windowFactory = LvglWidgetFactory(
|
|||||||
lv_style_set_radius(&factory->style, 0);
|
lv_style_set_radius(&factory->style, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
Window::Window(Window * parent, const rect_t & rect, WindowFlags windowFlags, LcdFlags textFlags, LvglWidgetFactory *factory) :
|
Window::Window(Window *parent, const rect_t &rect, WindowFlags windowFlags,
|
||||||
|
LcdFlags textFlags, LvglWidgetFactory *factory) :
|
||||||
parent(parent),
|
parent(parent),
|
||||||
rect(rect),
|
rect(rect),
|
||||||
innerWidth(rect.w),
|
innerWidth(rect.w),
|
||||||
@@ -131,7 +132,6 @@ Window::Window(Window * parent, const rect_t & rect, WindowFlags windowFlags, Lc
|
|||||||
windowFactory.construct(lvParent) :
|
windowFactory.construct(lvParent) :
|
||||||
factory->construct(lvParent);
|
factory->construct(lvParent);
|
||||||
|
|
||||||
|
|
||||||
lv_obj_add_style(lvobj, &windowFactory.style, LV_PART_MAIN);
|
lv_obj_add_style(lvobj, &windowFactory.style, LV_PART_MAIN);
|
||||||
lv_obj_set_pos(lvobj, rect.x, rect.y);
|
lv_obj_set_pos(lvobj, rect.x, rect.y);
|
||||||
lv_obj_set_size(lvobj, rect.w, rect.h);
|
lv_obj_set_size(lvobj, rect.w, rect.h);
|
||||||
|
|||||||
Reference in New Issue
Block a user