fix bugs discovered by tests
This commit is contained in:
2024-08-27 15:20:13 +02:00
parent d47510f58f
commit 33add7b306
2 changed files with 11 additions and 1 deletions
+9
View File
@@ -52,6 +52,15 @@ std::string UI_combobox::selected_text() const
void UI_combobox::from_json(const json& j)
{
UI_x_boxes::from_json(j);
std::string selected_str = j.at("selected");
for (size_t i = 0; i < m_options.size(); i++)
{
if (m_options[i] == selected_str)
{
m_selected = i;
break;
}
}
}
json UI_combobox::to_json() const