forked from AuroraMiddleware/gtk
button: Fix accessible implementation
Now that GtkButton is no longer a container, update the accessible implementation to match.
This commit is contained in:
parent
d7b1ecdf52
commit
af19c7275b
@ -68,30 +68,25 @@ get_image_from_button (GtkWidget *button)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
find_label_child (GtkContainer *container)
|
find_label_child (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
GList *children, *tmp_list;
|
|
||||||
GtkWidget *child;
|
GtkWidget *child;
|
||||||
|
|
||||||
children = gtk_container_get_children (container);
|
for (child = gtk_widget_get_first_child (widget);
|
||||||
|
child != NULL;
|
||||||
child = NULL;
|
child = gtk_widget_get_next_sibling (widget))
|
||||||
for (tmp_list = children; tmp_list != NULL; tmp_list = tmp_list->next)
|
|
||||||
{
|
{
|
||||||
if (GTK_IS_LABEL (tmp_list->data))
|
if (GTK_IS_LABEL (child))
|
||||||
|
return child;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
child = GTK_WIDGET (tmp_list->data);
|
GtkWidget *w = find_label_child (child);
|
||||||
break;
|
if (w)
|
||||||
}
|
return w;
|
||||||
else if (GTK_IS_CONTAINER (tmp_list->data))
|
|
||||||
{
|
|
||||||
child = find_label_child (GTK_CONTAINER (tmp_list->data));
|
|
||||||
if (child)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_list_free (children);
|
|
||||||
return child;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
@ -101,10 +96,8 @@ get_label_from_button (GtkWidget *button)
|
|||||||
|
|
||||||
child = gtk_button_get_child (GTK_BUTTON (button));
|
child = gtk_button_get_child (GTK_BUTTON (button));
|
||||||
|
|
||||||
if (GTK_IS_CONTAINER (child))
|
if (!GTK_IS_LABEL (child))
|
||||||
child = find_label_child (GTK_CONTAINER (child));
|
child = find_label_child (child);
|
||||||
else if (!GTK_IS_LABEL (child))
|
|
||||||
child = NULL;
|
|
||||||
|
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
@ -200,7 +193,6 @@ static void
|
|||||||
gtk_button_accessible_class_init (GtkButtonAccessibleClass *klass)
|
gtk_button_accessible_class_init (GtkButtonAccessibleClass *klass)
|
||||||
{
|
{
|
||||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||||
GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass;
|
|
||||||
GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass;
|
GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass;
|
||||||
|
|
||||||
class->get_name = gtk_button_accessible_get_name;
|
class->get_name = gtk_button_accessible_get_name;
|
||||||
@ -210,9 +202,6 @@ gtk_button_accessible_class_init (GtkButtonAccessibleClass *klass)
|
|||||||
class->initialize = gtk_button_accessible_initialize;
|
class->initialize = gtk_button_accessible_initialize;
|
||||||
|
|
||||||
widget_class->notify_gtk = gtk_button_accessible_notify_gtk;
|
widget_class->notify_gtk = gtk_button_accessible_notify_gtk;
|
||||||
|
|
||||||
container_class->add_gtk = NULL;
|
|
||||||
container_class->remove_gtk = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gtk/a11y/gtkcontaineraccessible.h>
|
#include <gtk/a11y/gtkwidgetaccessible.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@ -39,14 +39,14 @@ typedef struct _GtkButtonAccessiblePrivate GtkButtonAccessiblePrivate;
|
|||||||
|
|
||||||
struct _GtkButtonAccessible
|
struct _GtkButtonAccessible
|
||||||
{
|
{
|
||||||
GtkContainerAccessible parent;
|
GtkWidgetAccessible parent;
|
||||||
|
|
||||||
GtkButtonAccessiblePrivate *priv;
|
GtkButtonAccessiblePrivate *priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GtkButtonAccessibleClass
|
struct _GtkButtonAccessibleClass
|
||||||
{
|
{
|
||||||
GtkContainerAccessibleClass parent_class;
|
GtkWidgetAccessibleClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
|
Loading…
Reference in New Issue
Block a user