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/ComboBox.cpp | |
parent | 7c4af06d953ad439906f85ec996ad00dd38d2302 (diff) |
Add widgets for settings page, add list to auto position widgets
Diffstat (limited to 'src/gui/ComboBox.cpp')
-rw-r--r-- | src/gui/ComboBox.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/ComboBox.cpp b/src/gui/ComboBox.cpp index 81c804f..03e66bd 100644 --- a/src/gui/ComboBox.cpp +++ b/src/gui/ComboBox.cpp @@ -33,6 +33,7 @@ namespace gsr { if(mgl::FloatRect(pos - mgl::vec2f(padding_left, padding_top), item_size).contains(mouse_pos)) { selected_item = i; show_dropdown = false; + remove_widget_as_selected_in_parent(); return false; } pos.y += text_bounds.size.y + padding_top + padding_bottom; @@ -42,9 +43,13 @@ namespace gsr { if(mgl::FloatRect(draw_pos, item_size).contains(mouse_pos)) { show_dropdown = !show_dropdown; if(show_dropdown) - move_to_top = true; + set_widget_as_selected_in_parent(); + else + remove_widget_as_selected_in_parent(); + return false; } else { show_dropdown = false; + remove_widget_as_selected_in_parent(); } } return true; |