[gtk+/a11y] GtkHSV: set a suitable role for the accessible
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/a11y] GtkHSV: set a suitable role for the accessible
- Date: Thu, 23 Jun 2011 22:42:48 +0000 (UTC)
commit 4e30c07d66ba529a7c51261a87f567c3f32555d5
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jun 23 18:41:47 2011 -0400
GtkHSV: set a suitable role for the accessible
The consensus of the accessibility team was that 'color chooser'
fits best for this. Update tests to match.
gtk/gtkhsv.c | 15 +++++++++++++++
tests/a11y/colorchooser.txt | 2 +-
2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkhsv.c b/gtk/gtkhsv.c
index 913f6df..78be592 100644
--- a/gtk/gtkhsv.c
+++ b/gtk/gtkhsv.c
@@ -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;
+}
+
diff --git a/tests/a11y/colorchooser.txt b/tests/a11y/colorchooser.txt
index f89a1f1..c6ebb76 100644
--- a/tests/a11y/colorchooser.txt
+++ b/tests/a11y/colorchooser.txt
@@ -44,7 +44,7 @@ window1
layer: widget
alpha: 1
unnamed-GailWidget-4
- "unknown"
+ "color chooser"
parent: unnamed-GailBox-3
index: 0
name: Color Wheel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]