diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-07 00:21:32 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-07 00:21:35 +0200 |
commit | a3e479d5b289166ff651fac4ff046656cf78cda0 (patch) | |
tree | 2ba345228acfe45acf9863bb122e163ed38db7db /include/gui/Widget.hpp | |
parent | b229b060add5f66bd5532698c4a790285095e98a (diff) |
Add radio button with simple/advanced view, add widget visibility
Diffstat (limited to 'include/gui/Widget.hpp')
-rw-r--r-- | include/gui/Widget.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/gui/Widget.hpp b/include/gui/Widget.hpp index 6c4a1cb..7a04338 100644 --- a/include/gui/Widget.hpp +++ b/include/gui/Widget.hpp @@ -14,6 +14,12 @@ namespace gsr { friend class List; friend class Page; public: + enum class Alignment { + START, + CENTER, + END + }; + Widget(); Widget(const Widget&) = delete; Widget& operator=(const Widget&) = delete; @@ -28,12 +34,26 @@ namespace gsr { virtual mgl::vec2f get_position() const; virtual mgl::vec2f get_size() = 0; + + void set_horizontal_alignment(Alignment alignment); + void set_vertical_alignment(Alignment alignment); + + Alignment get_horizontal_alignment() const; + Alignment get_vertical_alignment() const; + + void set_visible(bool visible); protected: void set_widget_as_selected_in_parent(); void remove_widget_as_selected_in_parent(); + bool has_parent_with_selected_child_widget() const; protected: mgl::vec2f position; Widget *parent_widget = nullptr; Widget *selected_child_widget = nullptr; + + Alignment horizontal_aligment; + Alignment vertical_aligment; + + bool visible = true; }; }
\ No newline at end of file |