summaryrefslogtreecommitdiff
path: root/gtk/gtkmodelbutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-10-26 08:21:52 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-10-26 22:48:01 -0400
commit6cd3bc738477e86dd0c6645ccd994242b0251122 (patch)
tree3f20745a635c8727ec60f3fc8c33a60b6461e8bb /gtk/gtkmodelbutton.c
parent61e08baec1d55ee533a20ec5fffd91b797daa5d1 (diff)
downloadgtk+-6cd3bc738477e86dd0c6645ccd994242b0251122.tar.gz
modelbutton: Explicitly set up LABELLED-By relation
GTK does this automatically based on mnemonics, but only if the string actually contains a mnemonic. This makes orca read out menuitems, as expected.
Diffstat (limited to 'gtk/gtkmodelbutton.c')
-rw-r--r--gtk/gtkmodelbutton.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index 31d0bf10c5..4e4815fdc6 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -681,6 +681,11 @@ gtk_model_button_set_text (GtkModelButton *button,
gtk_label_set_text_with_mnemonic (GTK_LABEL (button->label),
text ? text : "");
update_visibility (button);
+
+ gtk_accessible_update_relation (GTK_ACCESSIBLE (button),
+ GTK_ACCESSIBLE_RELATION_LABELLED_BY, g_list_append (NULL, button->label),
+ -1);
+
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_TEXT]);
}