diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-02 23:38:23 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-02 23:53:28 +0200 |
commit | 2869ef7cec7de6bc744cdba9e753dbd0df4ab65b (patch) | |
tree | 1d15c5679197b38d42cabb3e74143ef63a930d84 /src/gui/Widget.cpp | |
parent | 7c4af06d953ad439906f85ec996ad00dd38d2302 (diff) |
Add widgets for settings page, add list to auto position widgets
Diffstat (limited to 'src/gui/Widget.cpp')
-rw-r--r-- | src/gui/Widget.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/Widget.cpp b/src/gui/Widget.cpp index 1dc4d98..3e966e5 100644 --- a/src/gui/Widget.cpp +++ b/src/gui/Widget.cpp @@ -16,4 +16,18 @@ namespace gsr { mgl::vec2f Widget::get_position() const { return position; } + + void Widget::set_widget_as_selected_in_parent() { + if(parent_widget) { + parent_widget->selected_child_widget = this; + parent_widget->set_widget_as_selected_in_parent(); + } + } + + void Widget::remove_widget_as_selected_in_parent() { + if(parent_widget && parent_widget->selected_child_widget == this) { + parent_widget->selected_child_widget = nullptr; + parent_widget->remove_widget_as_selected_in_parent(); + } + } }
\ No newline at end of file |