1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

LibGUI: Implement GToolbar separators.

This commit is contained in:
Andreas Kling 2019-03-07 23:01:36 +01:00
parent 054e4caf49
commit 949c98c5af
3 changed files with 39 additions and 1 deletions

View file

@ -197,8 +197,18 @@ public:
Point bottom_right() const { return { right(), bottom() }; }
void center_within(const Rect& other)
{
center_horizontally_within(other);
center_vertically_within(other);
}
void center_horizontally_within(const Rect& other)
{
set_x(other.center().x() - width() / 2);
}
void center_vertically_within(const Rect& other)
{
set_y(other.center().y() - height() / 2);
}