]> Pileus Git - ~andy/gtk/commitdiff
GtkHSV: set a suitable role for the accessible
authorMatthias Clasen <mclasen@redhat.com>
Thu, 23 Jun 2011 22:41:47 +0000 (18:41 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 Jul 2011 20:08:07 +0000 (16:08 -0400)
The consensus of the accessibility team was that 'color chooser'
fits best for this. Update tests to match.

gtk/gtkhsv.c
tests/a11y/colorchooser.txt

index 913f6dfdffc393654d89561df0f1aaba5497bfb7..78be5921caea721a71dc9829ad7d01ce778fadc9 100644 (file)
@@ -124,6 +124,7 @@ static gboolean gtk_hsv_focus                (GtkWidget          *widget,
                                               GtkDirectionType    direction);
 static void     gtk_hsv_move                 (GtkHSV             *hsv,
                                               GtkDirectionType    dir);
+static AtkObject *gtk_hsv_get_accessible     (GtkWidget          *widget);
 
 static guint hsv_signals[LAST_SIGNAL];
 
@@ -154,6 +155,7 @@ gtk_hsv_class_init (GtkHSVClass *class)
   widget_class->draw = gtk_hsv_draw;
   widget_class->focus = gtk_hsv_focus;
   widget_class->grab_broken_event = gtk_hsv_grab_broken;
+  widget_class->get_accessible = gtk_hsv_get_accessible;
 
   hsv_class->move = gtk_hsv_move;
 
@@ -1618,3 +1620,16 @@ gtk_hsv_move (GtkHSV          *hsv,
   
   gtk_hsv_set_color (hsv, hue, sat, val);
 }
+
+static AtkObject *
+gtk_hsv_get_accessible (GtkWidget *widget)
+{
+  AtkObject *obj;
+
+  obj = GTK_WIDGET_CLASS (gtk_hsv_parent_class)->get_accessible (widget);
+
+  atk_object_set_role (obj, ATK_ROLE_COLOR_CHOOSER);
+
+  return obj;
+}
+
index f89a1f1c18a4b4b28a67ed9068dcd2e636f03e4f..c6ebb761b9b2c13672e40f355baac12caa63e1b1 100644 (file)
@@ -44,7 +44,7 @@ window1
           layer: widget
           alpha: 1
           unnamed-GailWidget-4
-            "unknown"
+            "color chooser"
             parent: unnamed-GailBox-3
             index: 0
             name: Color Wheel