From 2e72916afbc3dc08b5914d69e19abf141c664e09 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 25 Jul 2022 23:08:06 +0200 Subject: [PATCH 1/2] restrict-applications-selector: Make rows not focusable The toggle switches remain focusable, but the rows should not be focusable. Otherwise tabbing through the list involves two tabs per row. The screen reader continues to work correctly with this MR applied: when tabbing to a new switch, it reads out the label from the row, plus the switch state. Signed-off-by: Philip Withnall Fixes: #52 --- libmalcontent-ui/restrict-applications-selector.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmalcontent-ui/restrict-applications-selector.c b/libmalcontent-ui/restrict-applications-selector.c index 1196284..2da2eee 100644 --- a/libmalcontent-ui/restrict-applications-selector.c +++ b/libmalcontent-ui/restrict-applications-selector.c @@ -357,6 +357,8 @@ create_row_for_app_cb (gpointer item, adw_action_row_add_suffix (ADW_ACTION_ROW (row), w); adw_action_row_set_activatable_widget (ADW_ACTION_ROW (row), w); + gtk_widget_set_focusable (GTK_WIDGET (row), FALSE); + /* Fetch status from AccountService */ g_object_set_data (G_OBJECT (row), "GtkSwitch", w); g_object_set_data_full (G_OBJECT (w), "GAppInfo", g_object_ref (app), g_object_unref); From 950abf2e441e52e285c8486cfffa05882874be8c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 25 Jul 2022 23:09:43 +0200 Subject: [PATCH 2/2] user-controls: Mark rows as not focusable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the controls inside them should be focusable. This saves having to press the tab key twice as much as needed. The row to open the restrict applications dialogue remains focusable, as it doesn’t contain an interactive widget. It’s essentially one big button. Signed-off-by: Philip Withnall Helps: #52 --- libmalcontent-ui/user-controls.ui | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libmalcontent-ui/user-controls.ui b/libmalcontent-ui/user-controls.ui index bfd3e45..5e948c1 100644 --- a/libmalcontent-ui/user-controls.ui +++ b/libmalcontent-ui/user-controls.ui @@ -31,6 +31,7 @@ Prevents {username} from running web browsers. Limited web content may still be available in other applications. 0 + False end @@ -79,6 +80,7 @@ Prevents {username} from installing applications. 0 + False end @@ -99,6 +101,7 @@ oars_button Restricts browsing or installation of applications to applications suitable for certain ages or above. 0 + False end