window: moved updateSize() from dialog

This commit is contained in:
Raphael Coeffic
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent ae5d1759f1
commit 603d9230c8
4 changed files with 15 additions and 14 deletions
-13
View File
@@ -31,19 +31,6 @@ DialogWindowContent::DialogWindowContent(Dialog* parent, const rect_t& rect) :
form.setFocus(SET_FOCUS_DEFAULT);
}
void DialogWindowContent::updateSize()
{
lv_obj_set_height(lvobj, LV_SIZE_CONTENT);
lv_obj_center(lvobj);
lv_obj_update_layout(lvobj);
rect.x = lv_obj_get_x(lvobj);
rect.y = lv_obj_get_y(lvobj);
rect.w = lv_obj_get_width(lvobj);
rect.h = lv_obj_get_height(lvobj);
invalidate();
}
void DialogWindowContent::deleteLater(bool detach, bool trash)
{
if (_deleted) return;
-1
View File
@@ -31,7 +31,6 @@ class DialogWindowContent : public ModalWindowContent
public:
DialogWindowContent(Dialog* parent, const rect_t& rect);
void updateSize();
void deleteLater(bool detach = true, bool trash = true) override;
#if defined(DEBUG_WINDOWS)
+13
View File
@@ -673,6 +673,19 @@ void Window::moveWindowsTop(coord_t y, coord_t delta)
}
}
void Window::updateSize()
{
lv_obj_set_height(lvobj, LV_SIZE_CONTENT);
lv_obj_center(lvobj);
lv_obj_update_layout(lvobj);
rect.x = lv_obj_get_x(lvobj);
rect.y = lv_obj_get_y(lvobj);
rect.w = lv_obj_get_width(lvobj);
rect.h = lv_obj_get_height(lvobj);
invalidate();
}
void Window::invalidate(const rect_t & rect)
{
if (lvobj) lv_obj_invalidate(lvobj);
+2
View File
@@ -391,6 +391,8 @@ class Window
void moveWindowsTop(coord_t y, coord_t delta);
void updateSize();
void invalidate()
{
invalidate({0, 0, rect.w, rect.h});