[gtk/a11y/atcontext-realize] a11y: Use the tooltip text as the accessible description



commit d88f7c9459bddb9facf8e6d7c5780f072e11cf18
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Nov 4 16:42:16 2020 +0000

    a11y: Use the tooltip text as the accessible description
    
    It's more common to have a tooltip as the accessible description than an
    explicit description. This is also the behaviour of GTK3.

 gtk/gtkwidget.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index e81488c4fb..023f0ceb3a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -9468,6 +9468,10 @@ gtk_widget_set_tooltip_text (GtkWidget  *widget,
   priv->tooltip_text = tooltip_text;
   priv->tooltip_markup = tooltip_markup;
 
+  gtk_accessible_update_property (GTK_ACCESSIBLE (widget),
+                                  GTK_ACCESSIBLE_PROPERTY_DESCRIPTION, priv->tooltip_text,
+                                  -1);
+
   gtk_widget_set_has_tooltip (widget, priv->tooltip_text != NULL);
   if (_gtk_widget_get_visible (widget))
     gtk_widget_trigger_tooltip_query (widget);
@@ -9550,6 +9554,10 @@ gtk_widget_set_tooltip_markup (GtkWidget  *widget,
                           NULL);
     }
 
+  gtk_accessible_update_property (GTK_ACCESSIBLE (widget),
+                                  GTK_ACCESSIBLE_PROPERTY_DESCRIPTION, priv->tooltip_text,
+                                  -1);
+
   gtk_widget_set_has_tooltip (widget, tooltip_markup != NULL);
   if (_gtk_widget_get_visible (widget))
     gtk_widget_trigger_tooltip_query (widget);


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