checkbutton: Delegate ::activate to the helper if appropriate
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 30 Jul 2021 05:40:48 +0000 (07:40 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 30 Jul 2021 18:34:24 +0000 (20:34 +0200)
If the button is associated with an action, the action is currently
only activated when the button is clicked, not when it is activated.

gtk/gtkcheckbutton.c

index 9860641ac695edc71cba9ee35550a48483113720..9471f6d3c6ced5f9e6d8c4cee2395beb33ae808b 100644 (file)
@@ -498,7 +498,10 @@ gtk_check_button_real_activate (GtkCheckButton *self)
   if (priv->active && (priv->group_prev || priv->group_next))
     return;
 
-  gtk_check_button_set_active (self, !gtk_check_button_get_active (self));
+  if (priv->action_helper)
+    gtk_action_helper_activate (priv->action_helper);
+  else
+    gtk_check_button_set_active (self, !gtk_check_button_get_active (self));
 }
 
 static void