[nautilus/661-broken-pathbar-w-high-contrast-on-nautilus-3-30] pathbar: Use flat style class



commit 1b6f1ef572f21fc7ebc0fe92361979701dea6230
Author: António Fernandes <antoniof gnome org>
Date:   Thu Aug 9 20:37:22 2018 +0100

    pathbar: Use flat style class
    
    We use custom CSS that undecorates pathbar buttons in Adwaita. However,
    this doesn't apply to HighContrast, which keeps button borders, and it
    looks bad because there are slashes between them.
    
    While some custom styling is still needed, some can be replaced using
    the public "flat" class, with the benefit of removing the button
    borders in HighContrast (as well as any 3rd party custom theme that
    supports the "flat" class).
    
    Do that. Also, remove the now pointless "linked" class.
    
    Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/661

 src/nautilus-pathbar.c        | 9 +++++----
 src/resources/css/Adwaita.css | 6 ------
 2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 78a944279..b3188d8de 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -228,8 +228,6 @@ nautilus_path_bar_init (NautilusPathBar *self)
     gtk_widget_set_margin_start (GTK_WIDGET (self), 6);
     gtk_widget_set_margin_end (GTK_WIDGET (self), 6);
 
-    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)),
-                                 GTK_STYLE_CLASS_LINKED);
     gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)),
                                  "path-bar");
 
@@ -1561,6 +1559,7 @@ make_button_data (NautilusPathBar *self,
     GFile *path;
     GtkWidget *child;
     ButtonData *button_data;
+    GtkStyleContext *style_context;
 
     path = nautilus_file_get_location (file);
     child = NULL;
@@ -1570,9 +1569,11 @@ make_button_data (NautilusPathBar *self,
 
     setup_button_type (button_data, self, path);
     button_data->button = gtk_toggle_button_new ();
-    gtk_style_context_add_class (gtk_widget_get_style_context (button_data->button),
-                                 "text-button");
     gtk_widget_set_focus_on_click (button_data->button, FALSE);
+
+    style_context = gtk_widget_get_style_context (button_data->button);
+    gtk_style_context_add_class (style_context, "text-button");
+    gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_FLAT);
     /* TODO update button type when xdg directories change */
 
     button_data->image = gtk_image_new ();
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 329611ec7..b1e510903 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -52,14 +52,8 @@
 /* Path bar */
 
 .path-bar button { /* undecorate the buttons */
-  border-color: transparent;
-  background-color: transparent;
   background-image: none;
-  box-shadow: none;
   border-radius: 0;
-  text-shadow: none;
-  -gtk-icon-shadow: none;
-  padding: 4px;
   border-width: 0px;
   margin: 0px;
 }


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