1
Fork 0
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:
Andreas Kling 2019-04-14 04:10:43 +02:00
parent 3f6408919f
commit 6dc9a6ef42

View file

@ -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 }); }