summaryrefslogtreecommitdiff
path: root/src/nautilus-window-slot.c
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2016-03-02 00:59:06 -0300
committerCarlos Soriano <csoriano@gnome.org>2018-03-23 14:45:06 +0100
commita0fd3c87aa78b503567d166ba79171d412cd118a (patch)
tree49153807eea5d753a231b453dc4325a23345b90b /src/nautilus-window-slot.c
parentbb58bef5045adaccaa73850190aa123849eda3ff (diff)
downloadnautilus-a0fd3c87aa78b503567d166ba79171d412cd118a.tar.gz
action-bar: implement NautilusActionBar
The new NautilusActionBar class handles everything needed to be an usable actionbar as envisioned by the available mockups.
Diffstat (limited to 'src/nautilus-window-slot.c')
-rw-r--r--src/nautilus-window-slot.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index c3260aeb0..a70ad452c 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -2748,8 +2748,21 @@ static void
change_view (NautilusWindowSlot *self)
{
NautilusWindowSlotPrivate *priv;
+ NautilusView *view;
+ gboolean view_changed;
priv = nautilus_window_slot_get_instance_private (self);
+ view = priv->new_content_view;
+ view_changed = priv->content_view != view;
+
+ /* Remove the old actionbar before switching to the new view */
+ if (view_changed &&
+ priv->content_view &&
+ nautilus_view_get_action_bar (priv->content_view))
+ {
+ gtk_container_remove (GTK_CONTAINER (self), nautilus_view_get_action_bar (priv->content_view));
+ }
+
/* Switch to the new content view.
* Destroy the extra location widgets first, since they might hold
* a pointer to the old view, which will possibly be destroyed inside
@@ -2768,6 +2781,17 @@ change_view (NautilusWindowSlot *self)
* add back the extra location widgets.
*/
nautilus_window_slot_setup_extra_location_widgets (self);
+
+ /* Add the actionbar (if any) after the extra location widgets are set */
+ if (view_changed && nautilus_view_get_action_bar (view))
+ {
+ GtkWidget *actionbar;
+
+ actionbar = nautilus_view_get_action_bar (view);
+
+ gtk_box_pack_end (GTK_BOX (self), actionbar, FALSE, FALSE, 0);
+ gtk_widget_show (actionbar);
+ }
}
static void