File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ void GWidget::set_relative_rect(const Rect& rect)
43
43
{
44
44
if (rect == m_relative_rect)
45
45
return ;
46
+
47
+ auto old_rect = m_relative_rect;
48
+
46
49
bool size_changed = m_relative_rect.size () != rect.size ();
47
50
m_relative_rect = rect;
48
51
@@ -51,6 +54,8 @@ void GWidget::set_relative_rect(const Rect& rect)
51
54
event (resize_event);
52
55
}
53
56
57
+ if (auto * parent = parent_widget ())
58
+ parent->update (old_rect);
54
59
update ();
55
60
}
56
61
Original file line number Diff line number Diff line change @@ -112,6 +112,9 @@ class GWidget : public CObject {
112
112
void resize (const Size& size) { set_relative_rect ({ relative_rect ().location (), size }); }
113
113
void resize (int width, int height) { resize ({ width, height }); }
114
114
115
+ void move_by (int x, int y) { move_by ({ x, y }); }
116
+ void move_by (const Point& delta) { set_relative_rect ({ relative_position ().translated (delta), size () }); }
117
+
115
118
Color background_color () const { return m_background_color; }
116
119
Color foreground_color () const { return m_foreground_color; }
117
120
You can’t perform that action at this time.
0 commit comments