mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Fix check bugs for UI_combobox and UI_slider
This commit is contained in:
@@ -18,14 +18,13 @@ UI_combobox::UI_combobox(const json& j)
|
||||
|
||||
void UI_combobox::set_selected(size_t selected)
|
||||
{
|
||||
if (selected != p_selected)
|
||||
{
|
||||
if (selected == p_selected)
|
||||
return;
|
||||
p_selected = selected;
|
||||
if (p_on_change != nullptr)
|
||||
{
|
||||
p_on_change(p_id, selected_text());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UI_combobox::set_selected(std::string selected)
|
||||
|
||||
@@ -14,6 +14,11 @@ UI_slider::UI_slider(const json& j)
|
||||
|
||||
void UI_slider::set_value(double value)
|
||||
{
|
||||
if (value < p_min || value > p_max)
|
||||
return;
|
||||
if (value == p_value)
|
||||
return;
|
||||
|
||||
if (p_on_change != nullptr)
|
||||
{
|
||||
this->p_value = value;
|
||||
|
||||
Reference in New Issue
Block a user