mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
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:
parent
9111aaf1f7
commit
bdd4d65e85
@ -218,10 +218,29 @@ gtk_link_button_accessible_finalize (GObject *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
|
||||
gtk_link_button_accessible_class_init (GtkLinkButtonAccessibleClass *klass)
|
||||
{
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ window1
|
||||
parent: window1
|
||||
index: 0
|
||||
name: Hello World!
|
||||
state: enabled focusable sensitive showing visible
|
||||
state: enabled focusable sensitive showing visible visited
|
||||
toolkit: gtk
|
||||
<AtkComponent>
|
||||
layer: widget
|
||||
|
@ -10,6 +10,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="uri">http://www.gtk.org</property>
|
||||
<property name="visited">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
Loading…
Reference in New Issue
Block a user