All widgets with such signals now emit them if the value is changed
programmatically, but only if it actually changed.
items[sel_index]->set_active(false);
if(i<0)
sel_index = -1;
- else
+ else if(i!=sel_index)
{
sel_index = i;
items[sel_index]->set_active(true);
void Toggle::set_value(bool v)
{
+ bool old_value = value;
+
value = v;
if(value)
{
}
else
clear_state(ACTIVE);
+
+ if(value!=old_value)
+ signal_toggled.emit(value);
}
void Toggle::rebuild_special(const Part &part)
if(pressed && btn==1)
{
if(geom.is_inside_relative(x, y) && (!value || !exclusive))
- {
set_value(!value);
- signal_toggled.emit(value);
- }
pressed = false;
}