1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:17:46 +00:00

LibGUI: Add ability to position checkboxes to the right of their text

This uses the new `checkbox_position` property, which can be "Left"
or "Right".
This commit is contained in:
Sam Atkins 2022-05-09 19:20:35 +01:00 committed by Andreas Kling
parent 0ef3c15822
commit aadb35ff46
3 changed files with 21 additions and 4 deletions

View file

@ -22,6 +22,13 @@ public:
bool is_autosize() const { return m_autosize; }
void set_autosize(bool);
enum class CheckBoxPosition {
Left,
Right,
};
CheckBoxPosition checkbox_position() const { return m_checkbox_position; }
void set_checkbox_position(CheckBoxPosition value) { m_checkbox_position = value; }
private:
explicit CheckBox(String = {});
@ -34,6 +41,7 @@ private:
virtual void paint_event(PaintEvent&) override;
bool m_autosize { false };
CheckBoxPosition m_checkbox_position { CheckBoxPosition::Left };
};
}