summaryrefslogtreecommitdiff
path: root/gtk/a11y
diff options
context:
space:
mode:
authorLukáš Tyrychtr <ltyrycht@redhat.com>2023-03-07 11:20:53 +0100
committerLukáš Tyrychtr <ltyrycht@redhat.com>2023-03-08 09:24:08 +0100
commit9517d3d13518489f647dccc6a870f04a8b028a0f (patch)
tree827b4547337c874b0a34a0014e5d4babc989295b /gtk/a11y
parentcfc2de4e3d93ef2bcad1f567eef4b430c9244549 (diff)
downloadgtk+-9517d3d13518489f647dccc6a870f04a8b028a0f.tar.gz
a11y: Add GTK_ACCESSIBLE_STATE_VISITED
This state is used for visited link-like widgets. It has no ARIA equivalent, e. g. can not be set programmatically, but it exists in the browser environment as well.
Diffstat (limited to 'gtk/a11y')
-rw-r--r--gtk/a11y/gtkatspicontext.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c
index dca263902e..a3a8eacefc 100644
--- a/gtk/a11y/gtkatspicontext.c
+++ b/gtk/a11y/gtkatspicontext.c
@@ -282,6 +282,16 @@ collect_states (GtkAtSpiContext *self,
}
}
+ if (gtk_at_context_has_accessible_state (ctx, GTK_ACCESSIBLE_STATE_VISITED))
+ {
+ value = gtk_at_context_get_accessible_state (ctx, GTK_ACCESSIBLE_STATE_VISITED);
+ if (value->value_class->type == GTK_ACCESSIBLE_VALUE_TYPE_BOOLEAN)
+ {
+ if (gtk_boolean_accessible_value_get (value))
+ set_atspi_state (&states, ATSPI_STATE_VISITED);
+ }
+ }
+
if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_REQUIRED))
{
value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_REQUIRED);
@@ -1048,6 +1058,15 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
emit_state_changed (self, "selectable", FALSE);
}
+ if (changed_states & GTK_ACCESSIBLE_STATE_CHANGE_VISITED)
+ {
+ value = gtk_accessible_attribute_set_get_value (states, GTK_ACCESSIBLE_STATE_VISITED);
+ if (value->value_class->type == GTK_ACCESSIBLE_VALUE_TYPE_BOOLEAN)
+ {
+ emit_state_changed (self, "visited",gtk_boolean_accessible_value_get (value));
+ }
+ }
+
if (changed_properties & GTK_ACCESSIBLE_PROPERTY_CHANGE_READ_ONLY)
{
gboolean readonly;