1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-05 07:57:35 +00:00

GWidget: Add move_by() and make set_relative_rect() invalidate parent.

This commit is contained in:
Andreas Kling 2019-04-16 22:59:27 +02:00
parent 486ed41fd2
commit ac324f14b8
2 changed files with 8 additions and 0 deletions

View file

@ -43,6 +43,9 @@ void GWidget::set_relative_rect(const Rect& rect)
{
if (rect == m_relative_rect)
return;
auto old_rect = m_relative_rect;
bool size_changed = m_relative_rect.size() != rect.size();
m_relative_rect = rect;
@ -51,6 +54,8 @@ void GWidget::set_relative_rect(const Rect& rect)
event(resize_event);
}
if (auto* parent = parent_widget())
parent->update(old_rect);
update();
}