Commit bfb054a0 authored by Emmanuele Bassi's avatar Emmanuele Bassi
Browse files

a11y: Icons in WindowControls are presentational only

They don't contribute anything to the accessible description.
parent e9407040
......@@ -273,15 +273,13 @@ update_window_buttons (GtkWindowControls *self)
if (strcmp (tokens[i], "icon") == 0 &&
is_sovereign_window)
{
button = gtk_image_new ();
/* The icon is not relevant for accessibility purposes */
button = g_object_new (GTK_TYPE_IMAGE,
"accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION,
NULL);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_widget_add_css_class (button, "icon");
/* The icon is not relevant for accessibility purposes */
gtk_accessible_update_state (GTK_ACCESSIBLE (button),
GTK_ACCESSIBLE_STATE_HIDDEN, TRUE,
-1);
if (!update_window_icon (window, button))
{
g_object_ref_sink (button);
......@@ -295,7 +293,11 @@ update_window_buttons (GtkWindowControls *self)
button = gtk_button_new ();
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_widget_add_css_class (button, "minimize");
image = gtk_image_new_from_icon_name ("window-minimize-symbolic");
/* The icon is not relevant for accessibility purposes */
image = g_object_new (GTK_TYPE_IMAGE,
"accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION,
"icon-name", "window-minimize-symbolic",
NULL);
g_object_set (image, "use-fallback", TRUE, NULL);
gtk_button_set_child (GTK_BUTTON (button), image);
gtk_widget_set_can_focus (button, FALSE);
......@@ -317,7 +319,11 @@ update_window_buttons (GtkWindowControls *self)
button = gtk_button_new ();
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_widget_add_css_class (button, "maximize");
image = gtk_image_new_from_icon_name (icon_name);
/* The icon is not relevant for accessibility purposes */
image = g_object_new (GTK_TYPE_IMAGE,
"accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION,
"icon-name", icon_name,
NULL);
g_object_set (image, "use-fallback", TRUE, NULL);
gtk_button_set_child (GTK_BUTTON (button), image);
gtk_widget_set_can_focus (button, FALSE);
......@@ -334,7 +340,11 @@ update_window_buttons (GtkWindowControls *self)
{
button = gtk_button_new ();
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
image = gtk_image_new_from_icon_name ("window-close-symbolic");
/* The icon is not relevant for accessibility purposes */
image = g_object_new (GTK_TYPE_IMAGE,
"accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION,
"icon-name", "window-close-symbolic",
NULL);
gtk_widget_add_css_class (button, "close");
g_object_set (image, "use-fallback", TRUE, NULL);
gtk_button_set_child (GTK_BUTTON (button), image);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment