]> Pileus Git - ~andy/gtk/commitdiff
Explicitly set the accessible name of GtkToolButton.
authorEitan Isaacson <eitan@ascender.com>
Tue, 6 Oct 2009 19:28:23 +0000 (12:28 -0700)
committerEitan Isaacson <eitan@ascender.com>
Sun, 11 Oct 2009 01:11:00 +0000 (18:11 -0700)
GAIL is not able to retrieve the correct button name alone, so it must be set in gtktoolbutton.c

https://bugzilla.gnome.org/show_bug.cgi?id=597596

gtk/gtktoolbutton.c

index 89231ea3ac8e6ce7ef4c94bccae04143da444e04..6db835861d4b878cd5a9ba7cecb5c8255669fc24 100644 (file)
@@ -906,6 +906,8 @@ gtk_tool_button_set_label (GtkToolButton *button,
                           const gchar   *label)
 {
   gchar *old_label;
+  gchar *elided_label;
+  AtkObject *accessible;
   
   g_return_if_fail (GTK_IS_TOOL_BUTTON (button));
 
@@ -914,6 +916,11 @@ gtk_tool_button_set_label (GtkToolButton *button,
   button->priv->label_text = g_strdup (label);
   button->priv->contents_invalid = TRUE;     
 
+  elided_label = _gtk_toolbar_elide_underscores (label);
+  accessible = gtk_widget_get_accessible (GTK_WIDGET (button->priv->button));
+  atk_object_set_name (accessible, elided_label);
+
+  g_free (elided_label);
   g_free (old_label);
  
   g_object_notify (G_OBJECT (button), "label");