diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-22 21:44:06 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-23 18:53:19 +0200 |
commit | 54c60d9a18d103011a12939c5029dd35a8e9e200 (patch) | |
tree | fefba1d63a13df6c135a6b1f5e8640b12a9c0ff5 /src/gui/ComboBox.cpp | |
parent | ba007c2b69dca6813c86115b2c1834de45c886be (diff) |
Start on file chooser, page stack
Diffstat (limited to 'src/gui/ComboBox.cpp')
-rw-r--r-- | src/gui/ComboBox.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/ComboBox.cpp b/src/gui/ComboBox.cpp index f23a323..b344c4e 100644 --- a/src/gui/ComboBox.cpp +++ b/src/gui/ComboBox.cpp @@ -146,14 +146,14 @@ namespace gsr { dirty = true; } - void ComboBox::set_selected_item(const std::string &id, bool trigger_event) { + void ComboBox::set_selected_item(const std::string &id, bool trigger_event, bool trigger_event_even_if_selection_not_changed) { for(size_t i = 0; i < items.size(); ++i) { auto &item = items[i]; if(item.id == id) { const size_t prev_selected_item = selected_item; selected_item = i; - if(trigger_event && selected_item != prev_selected_item && on_selection_changed) + if(trigger_event && (trigger_event_even_if_selection_not_changed || selected_item != prev_selected_item) && on_selection_changed) on_selection_changed(item.text.get_string(), item.id); break; |