Fix button down state when triggered by shortcut (#1145)

The visual feedback is really important. I was not aware that my patch suppressed that. And for the state values, I find it best to get back to what 1.3 did at this point. `value` is essential for check boxes and radio and toggle buttons. On push buttons, it has really not much of a meaning.
This commit is contained in:
dannye
2024-12-05 16:49:49 -06:00
committed by GitHub
parent 4317f6a15f
commit 85f5887625
-3
View File
@@ -192,17 +192,14 @@ int Fl_Button::handle(int event) {
do_callback(FL_REASON_RELEASED);
} else {
simulate_key_action();
value(1);
if (when() & FL_WHEN_CHANGED) {
set_changed();
Fl_Widget_Tracker wp(this);
do_callback(FL_REASON_CHANGED);
if (wp.deleted()) return 1;
value(0);
set_changed();
do_callback(FL_REASON_RELEASED);
} else if (when() & FL_WHEN_RELEASE) {
value(0);
set_changed();
do_callback(FL_REASON_RELEASED);
}