[nautilus/antoniof/goodbye-morphing-pathbar] toolbar: Always show pathbar background
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/antoniof/goodbye-morphing-pathbar] toolbar: Always show pathbar background
- Date: Mon, 5 Aug 2019 21:48:30 +0000 (UTC)
commit 58f0919161d3f79e854dc22d86f14cff0eec5e31
Author: António Fernandes <antoniof gnome org>
Date: Mon Aug 5 22:31:21 2019 +0100
toolbar: Always show pathbar background
We hide the pathbar background when the window is small enough that
the pathbar is no longer centered. This was introduced to make the
pathbar flat.
However, now that the pathbar is buttonized again, it doesn't make it
flat, so there is no point. Also, the transformation is surprising.
Furthermore, it is prone to styling glitches.
So, give up on the transformation and always have a pathbar background,
effectively reverting commit 080400bd243ab86d82954eaff0c866c3ac97f3f2
Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/907
src/nautilus-toolbar.c | 29 -----------------------------
src/resources/css/Adwaita.css | 30 +++++++++++++-----------------
src/resources/ui/nautilus-toolbar.ui | 1 +
3 files changed, 14 insertions(+), 46 deletions(-)
---
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index d14f17867..4ecb5ff6a 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -848,31 +848,6 @@ undo_manager_changed (NautilusToolbar *self)
update_menu_item (self->redo_button, self, "redo", redo_active, redo_label);
}
-static void
-on_notify_width_maximized (NautilusContainerMaxWidth *container,
- GParamSpec *pspec,
- gpointer user_data)
-{
- NautilusToolbar *self;
- GtkStyleContext *context;
- gboolean width_maximized;
-
- self = NAUTILUS_TOOLBAR (user_data);
- 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);
-
- if (width_maximized)
- {
- gtk_style_context_add_class (context, "width-maximized");
- }
- else
- {
- gtk_style_context_remove_class (context, "width-maximized");
- }
-}
-
static void
on_location_entry_close (GtkWidget *close_button,
NautilusToolbar *self)
@@ -936,10 +911,6 @@ nautilus_toolbar_constructed (GObject *object)
self->path_bar = g_object_new (NAUTILUS_TYPE_PATH_BAR, NULL);
gtk_container_add (GTK_CONTAINER (self->path_bar_container),
self->path_bar);
- g_signal_connect (self->toolbar_switcher_container_max_width,
- "notify::width-maximized",
- G_CALLBACK (on_notify_width_maximized),
- self);
self->location_entry = nautilus_location_entry_new ();
gtk_container_add (GTK_CONTAINER (self->location_entry_container),
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index e4126a1d1..1488c7017 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -45,33 +45,29 @@
/* Path bar */
-.nautilus-path-bar button { /* undecorate the buttons */
- margin: 0px;
-}
-
-.nautilus-path-bar button:not(:checked) image { opacity: 0.8; } /* dim the icon when not checked */
-
.path-bar-box {
- transition: border 200ms;
- transition: background-color 200ms;
border-radius: 5px;
-}
-
-.path-bar-box.width-maximized {
border: 1px @borders solid;
background-color: @theme_bg_color;
+ padding-right: 6px;
+}
+
+.nautilus-path-bar button {
+ margin: 0px;
}
-.path-bar-box.width-maximized button:first-child {
- border-radius: 5px 0px 0px 5px;
- border-width: 0px 1px 0px 0px;
+.nautilus-path-bar button:first-child {
+ border-width: 0px 1px 0px 0px;
+ border-radius: 5px 0px 0px 5px;
}
-.path-bar-box.width-maximized button:not(:first-child) {
- border-width: 0px 1px 0px 1px;
- border-radius: 0px 0px 0px 0px;
+.nautilus-path-bar button:not(:first-child) {
+ border-width: 0px 1px 0px 1px;
+ border-radius: 0px 0px 0px 0px;
}
+.nautilus-path-bar button:not(:checked) image { opacity: 0.8; } /* dim the icon when not checked */
+
/* Make the tags fit into the box */
entry.search > * {
margin: 5px;
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui
index de223157d..dc8e8133c 100644
--- a/src/resources/ui/nautilus-toolbar.ui
+++ b/src/resources/ui/nautilus-toolbar.ui
@@ -596,6 +596,7 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="margin_start">72</property>
<child>
<object class="GtkRevealer" id="operations_revealer">
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]