mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:58:11 +00:00
GWidget: Add direct setters for x, y, width & height.
This commit is contained in:
parent
3f6408919f
commit
6dc9a6ef42
1 changed files with 5 additions and 0 deletions
|
@ -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 }); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue