From 0009d0e771f1a7cb9adf12e78d66aefcccc766b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Thu, 27 Sep 2018 12:50:44 +0100 Subject: toolbar: Use GTK_STYLE_CLASS'es on the pathbar container box On wider windows, we show a border around the pathbar and fill it with background color using custom CSS specific for Adwaita. This means the pathbar is unbounded in HighContrast mode or 3rd party custom themes, giving the headerbar an uncentered, unbalanced layout. Fix that using the "frame" and "background" style class which are exposed by Gtk+ for this purpose. Closes: https://gitlab.gnome.org/GNOME/nautilus/issues/661 --- src/nautilus-toolbar.c | 8 +++++--- src/resources/css/Adwaita.css | 6 ------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c index fb0d2d4c0..12fc27a59 100644 --- a/src/nautilus-toolbar.c +++ b/src/nautilus-toolbar.c @@ -858,15 +858,17 @@ on_notify_width_maximized (NautilusContainerMaxWidth *container, context = gtk_widget_get_style_context (self->path_bar_container); width_maximized = nautilus_container_max_width_get_width_maximized (container); - g_return_if_fail (gtk_style_context_has_class (context, "width-maximized") != width_maximized); + g_return_if_fail (gtk_style_context_has_class (context, GTK_STYLE_CLASS_FRAME) != width_maximized); if (width_maximized) { - gtk_style_context_add_class (context, "width-maximized"); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_BACKGROUND); } else { - gtk_style_context_remove_class (context, "width-maximized"); + gtk_style_context_remove_class (context, GTK_STYLE_CLASS_FRAME); + gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND); } } diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css index b1e510903..ca7a3a9d4 100644 --- a/src/resources/css/Adwaita.css +++ b/src/resources/css/Adwaita.css @@ -65,14 +65,8 @@ .path-bar-box { transition: border 200ms; transition: background-color 200ms; -} -.path-bar-box.width-maximized { - border: 1px @borders solid; border-radius: 3px; } -.path-bar-box.width-maximized:not(:backdrop) { - background-color: @theme_bg_color; -} /* Make the tags fit into the box */ entry.search > * { -- cgit v1.2.1