diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-14 04:10:43 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-14 04:10:43 +0200 |
commit | 6dc9a6ef4224a779ebbaf419a3c1d09b6730939a (patch) | |
tree | 22f3767b78ca51865e6c6b6535ffea44746a4256 /LibGUI | |
parent | 3f6408919ff020a9fcf575a231cbbd8820c40a60 (diff) | |
download | serenity-6dc9a6ef4224a779ebbaf419a3c1d09b6730939a.zip |
GWidget: Add direct setters for x, y, width & height.
Diffstat (limited to 'LibGUI')
-rw-r--r-- | LibGUI/GWidget.h | 5 |
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 }); } |