diff options
author | Colomban Wendling <[email protected]> | 2025-04-02 00:18:22 +0200 |
---|---|---|
committer | Colomban Wendling <[email protected]> | 2025-04-03 00:25:57 +0200 |
commit | 30e3cf5dfbfd138a84a2a29ba3483a48f0cb04a4 (patch) | |
tree | a7e0c566885558d2cca9b738ad1c6a3c2bb81b88 | |
parent | 4abe18dbd3aeb1f609fde72a1f534bc5a829f6f2 (diff) | |
download | caja-a11y.tar.bz2 caja-a11y.tar.xz |
File properties: improve accessibility of the simple permissionsa11y
As the UI doesn't have semantic groups for owner/group/others settings
but they are only visually apparent, add some more context to the
accessible version of the labels to identify what it targets.
This is especially useful for the setting for other's permissions,
because the focus never lands on the line with the "Others" label,
hence making it hard to infer the context while navigating.
Another solution would be to redesign the UI to have semantic groups,
like e.g. labeled frames, but it's a lot less trivial and a lot more
intrusive a change.
-rw-r--r-- | src/file-manager/fm-properties-window.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 88a97e55..e615e1fa 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -4245,13 +4245,23 @@ add_permissions_combo_box (FMPropertiesWindow *window, GtkGrid *grid, GtkListStore *store; GtkCellRenderer *cell; GtkTreeIter iter; - - if (short_label) { - label = attach_title_field (grid, _("Access:")); - } else if (is_folder) { - label = attach_title_field (grid, _("Folder access:")); - } else { - label = attach_title_field (grid, _("File access:")); + AtkObject *atk_object; + static const gchar *const descriptions[4][3] = { + { N_("Access:"), N_("Folder access:"), N_("File access:") }, + /* As the UI lacks semantic grouping, provide more context for accessibility */ + { N_("User access:"), N_("User folder access:"), N_("User file access:") }, + { N_("Group access:"), N_("Group folder access:"), N_("Group file access:") }, + { N_("Others access:"), N_("Others folder access:"), N_("Others file access:") } + }; + const guint group = short_label ? 0 : is_folder ? 1 : 2; + + g_return_if_fail (type + 1 < G_N_ELEMENTS (descriptions)); + + label = attach_title_field (grid, _(descriptions[0][group])); + + atk_object = gtk_widget_get_accessible (GTK_WIDGET (label)); + if (GTK_IS_ACCESSIBLE (atk_object)) { + atk_object_set_name (atk_object, _(descriptions[type + 1][group])); } store = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_BOOLEAN); |