mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:07:35 +00:00
LibGUI: Allow specifying GButton text alignment.
This commit is contained in:
parent
1374195a0d
commit
89c544d97b
2 changed files with 7 additions and 2 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <AK/AKString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <SharedGraphics/GraphicsBitmap.h>
|
||||
#include <SharedGraphics/TextAlignment.h>
|
||||
|
||||
class GButton : public GWidget {
|
||||
public:
|
||||
|
@ -24,6 +25,9 @@ public:
|
|||
bool is_checked() const { return m_checked; }
|
||||
void set_checked(bool);
|
||||
|
||||
void set_text_alignment(TextAlignment text_alignment) { m_text_alignment = text_alignment; }
|
||||
TextAlignment text_alignment() const { return m_text_alignment; }
|
||||
|
||||
Function<void(GButton&)> on_click;
|
||||
|
||||
void set_button_style(ButtonStyle style) { m_button_style = style; }
|
||||
|
@ -44,6 +48,7 @@ private:
|
|||
String m_caption;
|
||||
RetainPtr<GraphicsBitmap> m_icon;
|
||||
ButtonStyle m_button_style { ButtonStyle::Normal };
|
||||
TextAlignment m_text_alignment { TextAlignment::Center };
|
||||
bool m_being_pressed { false };
|
||||
bool m_hovered { false };
|
||||
bool m_checkable { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue