diff options
Diffstat (limited to 'src/gui/RadioButton.cpp')
-rw-r--r-- | src/gui/RadioButton.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/RadioButton.cpp b/src/gui/RadioButton.cpp index 87428bf..66f3b69 100644 --- a/src/gui/RadioButton.cpp +++ b/src/gui/RadioButton.cpp @@ -121,14 +121,14 @@ namespace gsr { dirty = true; } - void RadioButton::set_selected_item(const std::string &id, bool trigger_event) { + void RadioButton::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; |