Proper enum parsing.

This commit is contained in:
Dario 2025-01-21 23:08:17 -03:00 committed by Mr-Wiseguy
parent d4ac88a373
commit 2fbc65d4ec

View file

@ -94,11 +94,14 @@ ConfigOptionRadio::ConfigOptionRadio(Element *parent, uint32_t value, const std:
this->callback = callback; this->callback = callback;
radio = get_current_context().create_element<Radio>(this); radio = get_current_context().create_element<Radio>(this);
radio->set_index(value);
radio->add_index_changed_callback(std::bind(&ConfigOptionRadio::index_changed, this, std::placeholders::_1)); radio->add_index_changed_callback(std::bind(&ConfigOptionRadio::index_changed, this, std::placeholders::_1));
for (std::string_view option : options) { for (std::string_view option : options) {
radio->add_option(option); radio->add_option(option);
} }
if (value < options.size()) {
radio->set_index(value);
}
} }
// ConfigSubMenu // ConfigSubMenu