[nautilus/661-broken-pathbar-w-high-contrast-on-nautilus-3-30-2] toolbar: Use GTK_STYLE_CLASS'es on the pathbar container box



commit 141d7b190700dba2503b34c6b8da8141dd54bf36
Author: António Fernandes <antoniof gnome org>
Date:   Thu Sep 27 12:50:44 2018 +0100

    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 > * {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]