[libadwaita/wip/exalm/scales: 1/2] action-row: Set a11y relationships for the activatable widgetd




commit 9e80b03e43fa39345f0932d31fa93188bc0f6258
Author: Lukáš Tyrychtr <lukastyrychtr gmail com>
Date:   Tue May 10 11:27:01 2022 +0200

    action-row: Set a11y relationships for the activatable widgetd

 src/adw-action-row.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/src/adw-action-row.c b/src/adw-action-row.c
index a5de7ec9..2e09f1c7 100644
--- a/src/adw-action-row.c
+++ b/src/adw-action-row.c
@@ -557,10 +557,16 @@ adw_action_row_set_activatable_widget (AdwActionRow *self,
 
   g_clear_pointer (&priv->activatable_binding, g_binding_unbind);
 
-  if (priv->activatable_widget)
+  if (priv->activatable_widget) {
+    gtk_accessible_reset_relation (GTK_ACCESSIBLE (priv->activatable_widget),
+                                   GTK_ACCESSIBLE_RELATION_LABELLED_BY);
+    gtk_accessible_reset_relation (GTK_ACCESSIBLE (priv->activatable_widget),
+                                   GTK_ACCESSIBLE_RELATION_DESCRIBED_BY);
+
     g_object_weak_unref (G_OBJECT (priv->activatable_widget),
                          activatable_widget_weak_notify,
                          self);
+  }
 
   priv->activatable_widget = widget;
 
@@ -573,6 +579,11 @@ adw_action_row_set_activatable_widget (AdwActionRow *self,
       g_object_bind_property (widget, "sensitive",
                               self, "activatable",
                               G_BINDING_SYNC_CREATE);
+
+    gtk_accessible_update_relation (GTK_ACCESSIBLE (priv->activatable_widget),
+                                    GTK_ACCESSIBLE_RELATION_LABELLED_BY, priv->title, NULL,
+                                    GTK_ACCESSIBLE_RELATION_DESCRIBED_BY, priv->subtitle, NULL,
+                                    -1);
   }
 
   g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ACTIVATABLE_WIDGET]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]