mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
b UI
fix bugs discovered by tests
This commit is contained in:
@@ -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
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ m_led_color(led_color)
|
||||
|
||||
}
|
||||
|
||||
UI_led::UI_led(const json& j) : UI_item(j)
|
||||
UI_led::UI_led(const json& j) :
|
||||
UI_item(UI_LED_TYPE)
|
||||
{
|
||||
from_json(j);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user