summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-02-03 02:09:44 -0500
committerMatthias Clasen <mclasen@redhat.com>2012-02-14 16:36:54 -0500
commitcc127c64a933da51f2f3ae6024b958eaa1fa6106 (patch)
tree84988d75db4a1d8692c1d5da309ad8d16ccd2946
parent327e36e3607453ba3f4b1418460babe5e19db02c (diff)
downloadgtk+-cc127c64a933da51f2f3ae6024b958eaa1fa6106.tar.gz
Add some accessible labels
-rw-r--r--gtk/gtkcolorplane.c11
-rw-r--r--gtk/gtkcolorscale.c13
2 files changed, 24 insertions, 0 deletions
diff --git a/gtk/gtkcolorplane.c b/gtk/gtkcolorplane.c
index 95f092accb..efc205cee6 100644
--- a/gtk/gtkcolorplane.c
+++ b/gtk/gtkcolorplane.c
@@ -22,8 +22,10 @@
#include "gtkhsv.h"
#include "gtkcolorplane.h"
#include "gtkcontainer.h"
+#include "gtkaccessible.h"
#include "gtkwindow.h"
#include "gtkbutton.h"
+#include "gtkintl.h"
struct _GtkColorPlanePrivate
{
@@ -385,6 +387,8 @@ sv_key_press (GtkWidget *widget,
static void
gtk_color_plane_init (GtkColorPlane *plane)
{
+ AtkObject *atk_obj;
+
plane->priv = G_TYPE_INSTANCE_GET_PRIVATE (plane,
GTK_TYPE_COLOR_PLANE,
GtkColorPlanePrivate);
@@ -393,6 +397,13 @@ gtk_color_plane_init (GtkColorPlane *plane)
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_POINTER_MOTION_MASK);
+
+ atk_obj = gtk_widget_get_accessible (GTK_WIDGET (plane));
+ if (GTK_IS_ACCESSIBLE (atk_obj))
+ {
+ atk_object_set_name (atk_obj, _("Color Plane"));
+ atk_object_set_role (atk_obj, ATK_ROLE_COLOR_CHOOSER);
+ }
}
static void
diff --git a/gtk/gtkcolorscale.c b/gtk/gtkcolorscale.c
index 60ef228613..9e8401ea26 100644
--- a/gtk/gtkcolorscale.c
+++ b/gtk/gtkcolorscale.c
@@ -23,6 +23,7 @@
#include "gtkhsv.h"
#include "gtkorientable.h"
#include "gtkstylecontext.h"
+#include "gtkaccessible.h"
#include "gtkintl.h"
struct _GtkColorScalePrivate
@@ -312,11 +313,23 @@ void
gtk_color_scale_set_type (GtkColorScale *scale,
GtkColorScaleType type)
{
+ AtkObject *atk_obj;
+
scale->priv->type = type;
cairo_surface_destroy (scale->priv->surface);
scale->priv->surface = NULL;
create_surface (scale);
gtk_widget_queue_draw (GTK_WIDGET (scale));
+
+ atk_obj = gtk_widget_get_accessible (GTK_WIDGET (scale));
+ if (GTK_IS_ACCESSIBLE (atk_obj))
+ {
+ if (type == GTK_COLOR_SCALE_HUE)
+ atk_object_set_name (atk_obj, C_("Color channel", "Hue"));
+ else if (type == GTK_COLOR_SCALE_ALPHA)
+ atk_object_set_name (atk_obj, C_("Color channel", "Alpha"));
+ atk_object_set_role (gtk_widget_get_accessible (GTK_WIDGET (scale)), ATK_ROLE_COLOR_CHOOSER);
+ }
}
GtkWidget *