Commit cc127c64 authored by Matthias Clasen's avatar Matthias Clasen

Add some accessible labels

parent 327e36e3
......@@ -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
......
......@@ -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 *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment