summaryrefslogtreecommitdiff
path: root/LibGUI
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-14 04:10:43 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-14 04:10:43 +0200
commit6dc9a6ef4224a779ebbaf419a3c1d09b6730939a (patch)
tree22f3767b78ca51865e6c6b6535ffea44746a4256 /LibGUI
parent3f6408919ff020a9fcf575a231cbbd8820c40a60 (diff)
downloadserenity-6dc9a6ef4224a779ebbaf419a3c1d09b6730939a.zip
GWidget: Add direct setters for x, y, width & height.
Diffstat (limited to 'LibGUI')
-rw-r--r--LibGUI/GWidget.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/LibGUI/GWidget.h b/LibGUI/GWidget.h
index d7050b4734..789a025d08 100644
--- a/LibGUI/GWidget.h
+++ b/LibGUI/GWidget.h
@@ -100,6 +100,11 @@ public:
void set_relative_rect(const Rect&);
void set_relative_rect(int x, int y, int width, int height) { set_relative_rect({ x, y, width, height }); }
+ void set_x(int x) { set_relative_rect(x, y(), width(), height()); }
+ void set_y(int y) { set_relative_rect(x(), y, width(), height()); }
+ void set_width(int width) { set_relative_rect(x(), y(), width, height()); }
+ void set_height(int height) { set_relative_rect(x(), y(), width(), height); }
+
void move_to(const Point& point) { set_relative_rect({ point, relative_rect().size() }); }
void move_to(int x, int y) { move_to({ x, y }); }
void resize(const Size& size) { set_relative_rect({ relative_rect().location(), size }); }