[gtk/ebassi/new-a11y: 9/32] Update the accessible state on widget visibility changes



commit 71525a013ae427dcfd3e3a47ce33be6b154d421b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Jul 7 17:51:01 2020 +0100

    Update the accessible state on widget visibility changes
    
    The GTK_ACCESSIBLE_STATE_HIDDEN has the opposite meaning of the
    GtkWidget:visible property.

 gtk/gtkwidget.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 54e57cbab9..cebf881abf 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2576,6 +2576,10 @@ gtk_widget_show (GtkWidget *widget)
       g_signal_emit (widget, widget_signals[SHOW], 0);
       g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_VISIBLE]);
 
+      gtk_accessible_update_state (GTK_ACCESSIBLE (widget),
+                                   GTK_ACCESSIBLE_STATE_HIDDEN, FALSE,
+                                   -1);
+
       gtk_widget_pop_verify_invariants (widget);
       g_object_unref (widget);
     }
@@ -2636,6 +2640,10 @@ gtk_widget_hide (GtkWidget *widget)
       g_signal_emit (widget, widget_signals[HIDE], 0);
       g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_VISIBLE]);
 
+      gtk_accessible_update_state (GTK_ACCESSIBLE (widget),
+                                   GTK_ACCESSIBLE_STATE_HIDDEN, TRUE,
+                                   -1);
+
       parent = gtk_widget_get_parent (widget);
       if (parent)
        gtk_widget_queue_resize (parent);


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