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

GButton: Align the button text according to text_alignment().

Added a Rect::align_within(other_rect, alignment) helper that seemed useful.
This commit is contained in:
Andreas Kling 2019-05-25 20:15:52 +02:00
parent 75b0e5cce5
commit cca510162e
3 changed files with 27 additions and 4 deletions

View file

@ -1,8 +1,9 @@
#pragma once
#include "Point.h"
#include "Size.h"
#include <AK/AKString.h>
#include <SharedGraphics/Point.h>
#include <SharedGraphics/Size.h>
#include <SharedGraphics/TextAlignment.h>
struct WSAPI_Rect;
@ -207,6 +208,8 @@ public:
Point bottom_left() const { return { left(), bottom() }; }
Point bottom_right() const { return { right(), bottom() }; }
void align_within(const Rect&, TextAlignment);
void center_within(const Rect& other)
{
center_horizontally_within(other);