1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibGUI: Make it possible to tweak icon spacing on a GUI::Button

This is the space between the icon and the text on buttons that have
both icon and text.
This commit is contained in:
Andreas Kling 2021-03-25 22:41:40 +01:00
parent 11e190b323
commit 32c6e31f4c
2 changed files with 6 additions and 2 deletions

View file

@ -60,6 +60,9 @@ public:
virtual bool is_uncheckable() const override;
int icon_spacing() const { return m_icon_spacing; }
void set_icon_spacing(int spacing) { m_icon_spacing = spacing; }
protected:
explicit Button(String text = {});
virtual void paint_event(PaintEvent&) override;
@ -69,6 +72,7 @@ private:
Gfx::ButtonStyle m_button_style { Gfx::ButtonStyle::Normal };
Gfx::TextAlignment m_text_alignment { Gfx::TextAlignment::Center };
WeakPtr<Action> m_action;
int m_icon_spacing { 4 };
};
}