[gtk/ebassi/new-a11y: 76/87] a11y: Update the "pressed" state on toggle buttons



commit 7773eba9b4f7024427f44b719bcb950d68c535e2
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Jul 13 16:10:36 2020 +0100

    a11y: Update the "pressed" state on toggle buttons

 gtk/gtktogglebutton.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index ee7f71f6b8..c9c55b98d2 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -26,7 +26,9 @@
 
 #include "gtktogglebutton.h"
 
+#include "gtkaccessible.h"
 #include "gtkbuttonprivate.h"
+#include "gtkenums.h"
 #include "gtkintl.h"
 #include "gtklabel.h"
 #include "gtkmain.h"
@@ -311,6 +313,10 @@ gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
   else
     gtk_widget_unset_state_flags (GTK_WIDGET (toggle_button), GTK_STATE_FLAG_CHECKED);
 
+  gtk_accessible_update_state (GTK_ACCESSIBLE (toggle_button),
+                               GTK_ACCESSIBLE_STATE_PRESSED, is_active,
+                               -1);
+
   gtk_toggle_button_toggled (toggle_button);
 
   g_object_notify_by_pspec (G_OBJECT (toggle_button), toggle_button_props[PROP_ACTIVE]);


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