- fix window position functions to call lvgl

This commit is contained in:
kkoenig1@optonline.com
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent af575f20f1
commit b71cfcd8eb
+9
View File
@@ -187,12 +187,16 @@ class Window
void setRect(rect_t value) void setRect(rect_t value)
{ {
rect = value; rect = value;
lv_obj_set_pos(lvobj, rect.x, rect.y);
lv_obj_set_width(lvobj, rect.w);
lv_obj_set_height(lvobj, rect.h);
invalidate(); invalidate();
} }
void setWidth(coord_t value) void setWidth(coord_t value)
{ {
rect.w = value; rect.w = value;
lv_obj_set_width(lvobj, rect.w);
invalidate(); invalidate();
} }
@@ -200,11 +204,14 @@ class Window
{ {
rect.x = (parent->width() - width()) / 2; rect.x = (parent->width() - width()) / 2;
rect.y = (parent->height() - height()) / 2; rect.y = (parent->height() - height()) / 2;
lv_obj_set_pos(lvobj, rect.x, rect.y);
} }
void setHeight(coord_t value) void setHeight(coord_t value)
{ {
rect.h = value; rect.h = value;
lv_obj_set_height(lvobj, rect.h);
if (windowFlags & FORWARD_SCROLL) if (windowFlags & FORWARD_SCROLL)
innerHeight = value; innerHeight = value;
else if (innerHeight <= value) { else if (innerHeight <= value) {
@@ -216,12 +223,14 @@ class Window
void setLeft(coord_t x) void setLeft(coord_t x)
{ {
rect.x = x; rect.x = x;
lv_obj_set_pos(lvobj, rect.x, rect.y);
invalidate(); invalidate();
} }
void setTop(coord_t y) void setTop(coord_t y)
{ {
rect.y = y; rect.y = y;
lv_obj_set_pos(lvobj, rect.x, rect.y);
invalidate(); invalidate();
} }