Small improvement to GtkLinkButton a11y
ATK has a visited state, so propagate the visited property of GtkLinkButton to that state.
This commit is contained in:
@ -218,10 +218,29 @@ gtk_link_button_accessible_finalize (GObject *object)
|
|||||||
G_OBJECT_CLASS (gtk_link_button_accessible_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gtk_link_button_accessible_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static AtkStateSet *
|
||||||
|
gtk_link_button_ref_state_set (AtkObject *accessible)
|
||||||
|
{
|
||||||
|
AtkStateSet *state_set;
|
||||||
|
GtkWidget *widget;
|
||||||
|
|
||||||
|
state_set = ATK_OBJECT_CLASS (gtk_link_button_accessible_parent_class)->ref_state_set (accessible);
|
||||||
|
|
||||||
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
|
||||||
|
if (widget != NULL)
|
||||||
|
{
|
||||||
|
if (gtk_link_button_get_visited (GTK_LINK_BUTTON (widget)))
|
||||||
|
atk_state_set_add_state (state_set, ATK_STATE_VISITED);
|
||||||
|
}
|
||||||
|
|
||||||
|
return state_set;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_link_button_accessible_class_init (GtkLinkButtonAccessibleClass *klass)
|
gtk_link_button_accessible_class_init (GtkLinkButtonAccessibleClass *klass)
|
||||||
{
|
{
|
||||||
G_OBJECT_CLASS (klass)->finalize = gtk_link_button_accessible_finalize;
|
G_OBJECT_CLASS (klass)->finalize = gtk_link_button_accessible_finalize;
|
||||||
|
ATK_OBJECT_CLASS (klass)->ref_state_set = gtk_link_button_ref_state_set;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@ -11,7 +11,7 @@ window1
|
|||||||
parent: window1
|
parent: window1
|
||||||
index: 0
|
index: 0
|
||||||
name: Hello World!
|
name: Hello World!
|
||||||
state: enabled focusable sensitive showing visible
|
state: enabled focusable sensitive showing visible visited
|
||||||
toolkit: gtk
|
toolkit: gtk
|
||||||
<AtkComponent>
|
<AtkComponent>
|
||||||
layer: widget
|
layer: widget
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="uri">http://www.gtk.org</property>
|
<property name="uri">http://www.gtk.org</property>
|
||||||
|
<property name="visited">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
Reference in New Issue
Block a user