Fix an a11y regression

This commit is contained in:
Matthias Clasen 2006-12-04 17:56:30 +00:00
parent 0f1bcb0fd6
commit 59ac825fed
2 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-12-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmessagedialog.c (setup_type): Set a11y name and role
since we no longer set window titles.
2006-12-04 Christian Persch <chpe@cvs.gnome.org>
* gtk/gtkpagesetup.c: (gtk_page_setup_get_paper_size),

View File

@ -29,6 +29,7 @@
#include <string.h>
#include "gtkmessagedialog.h"
#include "gtkaccessible.h"
#include "gtklabel.h"
#include "gtkhbox.h"
#include "gtkvbox.h"
@ -308,6 +309,7 @@ setup_type (GtkMessageDialog *dialog,
{
GtkMessageDialogPrivate *priv = GTK_MESSAGE_DIALOG_GET_PRIVATE (dialog);
const gchar *stock_id = NULL;
AtkObject *atk_obj;
priv->message_type = type;
@ -340,6 +342,19 @@ setup_type (GtkMessageDialog *dialog,
if (stock_id)
gtk_image_set_from_stock (GTK_IMAGE (dialog->image), stock_id,
GTK_ICON_SIZE_DIALOG);
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dialog));
if (GTK_IS_ACCESSIBLE (atk_obj))
{
atk_object_set_role (atk_obj, ATK_ROLE_ALERT);
if (stock_id)
{
GtkStockItem item;
gtk_stock_lookup (stock_id, &item);
atk_object_set_name (atk_obj, item.label);
}
}
}
static void