passwordentry: Change an accessible role
authorMatthias Clasen <mclasen@redhat.com>
Sun, 11 Jun 2023 16:37:06 +0000 (12:37 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 12 Jun 2023 00:29:25 +0000 (20:29 -0400)
The caps-lock icon is really an alert. Maybe
this is in vain, since orca ignores these images.

gtk/gtkpasswordentry.c

index 7cd496d45f53a4c0f22475a14ad2e741ad572219..e88e2d14fe5ce9de63996b5b652df495a3eef71c 100644 (file)
@@ -208,7 +208,10 @@ gtk_password_entry_init (GtkPasswordEntry *entry)
   g_signal_connect_swapped (entry->entry, "notify::has-focus", G_CALLBACK (focus_changed), entry);
   g_signal_connect_swapped (entry->entry, "activate", G_CALLBACK (activate_cb), entry);
 
-  entry->icon = gtk_image_new_from_icon_name ("caps-lock-symbolic");
+  entry->icon = g_object_new (GTK_TYPE_IMAGE,
+                              "icon-name", "caps-lock-symbolic",
+                              "accessible-role", GTK_ACCESSIBLE_ROLE_ALERT,
+                              NULL);
   gtk_widget_set_tooltip_text (entry->icon, _("Caps Lock is on"));
   gtk_widget_add_css_class (entry->icon, "caps-lock-indicator");
   gtk_widget_set_cursor (entry->icon, gtk_widget_get_cursor (entry->entry));