Add a11y relations between the color wheel and the spin buttons. (#132745,

2004-04-14  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkcolorsel.c: Add a11y relations between the color
	wheel and the spin buttons.  (#132745, Padraig, O'Briain)

	* gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
	the meaning of size == -1.

	* gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept
	a size of -1.  (#137436, Brian Cameron)
This commit is contained in:
Matthias Clasen 2004-04-14 21:04:29 +00:00 committed by Matthias Clasen
parent b18a684f28
commit 321cedab98
8 changed files with 87 additions and 3 deletions

View File

@ -1,5 +1,14 @@
2004-04-14 Matthias Clasen <mclasen@redhat.com> 2004-04-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcolorsel.c: Add a11y relations between the color
wheel and the spin buttons. (#132745)
* gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
the meaning of size == -1.
* gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept
a size of -1. (#137436, Brian Cameron)
* gtk/gtkcombobox.c: Make the arrow and separator regular * gtk/gtkcombobox.c: Make the arrow and separator regular
children of an hbox inside the button, and propagate state children of an hbox inside the button, and propagate state
changes from the button to the cell view. (part of the fix changes from the button to the cell view. (part of the fix

View File

@ -1,5 +1,14 @@
2004-04-14 Matthias Clasen <mclasen@redhat.com> 2004-04-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcolorsel.c: Add a11y relations between the color
wheel and the spin buttons. (#132745)
* gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
the meaning of size == -1.
* gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept
a size of -1. (#137436, Brian Cameron)
* gtk/gtkcombobox.c: Make the arrow and separator regular * gtk/gtkcombobox.c: Make the arrow and separator regular
children of an hbox inside the button, and propagate state children of an hbox inside the button, and propagate state
changes from the button to the cell view. (part of the fix changes from the button to the cell view. (part of the fix

View File

@ -1,5 +1,14 @@
2004-04-14 Matthias Clasen <mclasen@redhat.com> 2004-04-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcolorsel.c: Add a11y relations between the color
wheel and the spin buttons. (#132745)
* gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
the meaning of size == -1.
* gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept
a size of -1. (#137436, Brian Cameron)
* gtk/gtkcombobox.c: Make the arrow and separator regular * gtk/gtkcombobox.c: Make the arrow and separator regular
children of an hbox inside the button, and propagate state children of an hbox inside the button, and propagate state
changes from the button to the cell view. (part of the fix changes from the button to the cell view. (part of the fix

View File

@ -1,5 +1,14 @@
2004-04-14 Matthias Clasen <mclasen@redhat.com> 2004-04-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcolorsel.c: Add a11y relations between the color
wheel and the spin buttons. (#132745)
* gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
the meaning of size == -1.
* gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept
a size of -1. (#137436, Brian Cameron)
* gtk/gtkcombobox.c: Make the arrow and separator regular * gtk/gtkcombobox.c: Make the arrow and separator regular
children of an hbox inside the button, and propagate state children of an hbox inside the button, and propagate state
changes from the button to the cell view. (part of the fix changes from the button to the cell view. (part of the fix

View File

@ -1,5 +1,14 @@
2004-04-14 Matthias Clasen <mclasen@redhat.com> 2004-04-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcolorsel.c: Add a11y relations between the color
wheel and the spin buttons. (#132745)
* gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
the meaning of size == -1.
* gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept
a size of -1. (#137436, Brian Cameron)
* gtk/gtkcombobox.c: Make the arrow and separator regular * gtk/gtkcombobox.c: Make the arrow and separator regular
children of an hbox inside the button, and propagate state children of an hbox inside the button, and propagate state
changes from the button to the cell view. (part of the fix changes from the button to the cell view. (part of the fix

View File

@ -58,6 +58,7 @@
#include "gtkintl.h" #include "gtkintl.h"
#include "gtkimage.h" #include "gtkimage.h"
#include "gtkstock.h" #include "gtkstock.h"
#include "gtkaccessible.h"
#include <string.h> #include <string.h>
@ -170,6 +171,10 @@ static void default_noscreen_change_palette_func (const GdkColor *colo
static void default_change_palette_func (GdkScreen *screen, static void default_change_palette_func (GdkScreen *screen,
const GdkColor *colors, const GdkColor *colors,
gint n_colors); gint n_colors);
static void make_control_relations (AtkObject *atk_obj,
GtkWidget *widget);
static void make_all_relations (AtkObject *atk_obj,
ColorSelectionPrivate *priv);
static gpointer parent_class = NULL; static gpointer parent_class = NULL;
static guint color_selection_signals[LAST_SIGNAL] = { 0 }; static guint color_selection_signals[LAST_SIGNAL] = { 0 };
@ -1813,6 +1818,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
GtkWidget *picker_image; GtkWidget *picker_image;
gint i, j; gint i, j;
ColorSelectionPrivate *priv; ColorSelectionPrivate *priv;
AtkObject *atk_obj;
gtk_widget_push_composite_child (); gtk_widget_push_composite_child ();
@ -1975,6 +1981,14 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
gtk_widget_hide (priv->palette_frame); gtk_widget_hide (priv->palette_frame);
} }
atk_obj = gtk_widget_get_accessible (priv->triangle_colorsel);
if (GTK_IS_ACCESSIBLE (atk_obj))
{
atk_object_set_name (atk_obj, _("Color Wheel"));
atk_object_set_role (gtk_widget_get_accessible (GTK_WIDGET (colorsel)), ATK_ROLE_COLOR_CHOOSER);
make_all_relations (atk_obj, priv);
}
gtk_widget_pop_composite_child (); gtk_widget_pop_composite_child ();
} }
@ -2755,3 +2769,26 @@ gtk_color_selection_set_change_palette_with_screen_hook (GtkColorSelectionChange
return old; return old;
} }
static void
make_control_relations (AtkObject *atk_obj,
GtkWidget *widget)
{
AtkObject *obj;
obj = gtk_widget_get_accessible (widget);
atk_object_add_relationship (atk_obj, ATK_RELATION_CONTROLLED_BY, obj);
atk_object_add_relationship (obj, ATK_RELATION_CONTROLLER_FOR, atk_obj);
}
static void
make_all_relations (AtkObject *atk_obj,
ColorSelectionPrivate *priv)
{
make_control_relations (atk_obj, priv->hue_spinbutton);
make_control_relations (atk_obj, priv->sat_spinbutton);
make_control_relations (atk_obj, priv->val_spinbutton);
make_control_relations (atk_obj, priv->red_spinbutton);
make_control_relations (atk_obj, priv->green_spinbutton);
make_control_relations (atk_obj, priv->blue_spinbutton);
}

View File

@ -1738,7 +1738,8 @@ render_fallback_image (GtkStyle *style,
* @style: a #GtkStyle associated with @widget, or %NULL * @style: a #GtkStyle associated with @widget, or %NULL
* @direction: text direction * @direction: text direction
* @state: widget state * @state: widget state
* @size: icon size * @size: icon size. A size of (GtkIconSize)-1
* means render at the size of the source and don't scale.
* @widget: widget that will display the icon, or %NULL. * @widget: widget that will display the icon, or %NULL.
* The only use that is typically made of this * The only use that is typically made of this
* is to determine the appropriate #GdkScreen. * is to determine the appropriate #GdkScreen.

View File

@ -5015,7 +5015,8 @@ gtk_widget_create_pango_layout (GtkWidget *widget,
* gtk_widget_render_icon: * gtk_widget_render_icon:
* @widget: a #GtkWidget * @widget: a #GtkWidget
* @stock_id: a stock ID * @stock_id: a stock ID
* @size: a stock size * @size: a stock size. A size of (GtkIconSize)-1 means render at
the size of the source and don't scale.
* @detail: render detail to pass to theme engine * @detail: render detail to pass to theme engine
* *
* A convenience function that uses the theme engine and RC file * A convenience function that uses the theme engine and RC file
@ -5043,7 +5044,7 @@ gtk_widget_render_icon (GtkWidget *widget,
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (stock_id != NULL, NULL); g_return_val_if_fail (stock_id != NULL, NULL);
g_return_val_if_fail (size > GTK_ICON_SIZE_INVALID, NULL); g_return_val_if_fail (size > GTK_ICON_SIZE_INVALID || size == -1, NULL);
gtk_widget_ensure_style (widget); gtk_widget_ensure_style (widget);