diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-07 20:32:59 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-07 20:32:59 +0200 |
commit | b709805cfac4d1fe1bfe28e497a3e48e224372a8 (patch) | |
tree | 82f4bb638805dd58017d933fafd2143eb8019637 /include/gui/ComboBox.hpp | |
parent | 2ea32e11093a4d057338c02abbff4807446ff8de (diff) |
Move settings ui to SettingsPage class, show different widgets for different settings page, show different widgets depending on combobox selections
Diffstat (limited to 'include/gui/ComboBox.hpp')
-rw-r--r-- | include/gui/ComboBox.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/gui/ComboBox.hpp b/include/gui/ComboBox.hpp index b4e7b78..ac9d02b 100644 --- a/include/gui/ComboBox.hpp +++ b/include/gui/ComboBox.hpp @@ -3,6 +3,8 @@ #include "Widget.hpp" #include <mglpp/graphics/Text.hpp> #include <mglpp/graphics/Sprite.hpp> + +#include <functional> #include <string> #include <vector> @@ -17,9 +19,11 @@ namespace gsr { void draw(mgl::Window &window, mgl::vec2f offset) override; void add_item(const std::string &text, const std::string &id); - void set_selected_item(const std::string &id); + void set_selected_item(const std::string &id, bool trigger_event = true); mgl::vec2f get_size() override; + + std::function<void(const std::string &text, const std::string &id)> on_selection_changed; private: void update_if_dirty(); float get_dropdown_arrow_height() const; |