[gtk: 1/3] checkbutton: Delegate ::activate to the helper if appropriate




commit c50475de34f66a97ea8fb57c722d7290b9f60d44
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 30 07:40:48 2021 +0200

    checkbutton: Delegate ::activate to the helper if appropriate
    
    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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index 9860641ac6..9471f6d3c6 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]