diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2016-03-02 01:03:25 -0300 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2016-06-20 12:36:28 -0300 |
commit | e5e14eef9e44659a4d8bb22b33adb3e4afeb2453 (patch) | |
tree | 56207189f68920ce6a5c49ffb7098adcb0c19c9c | |
parent | 491038c247e0888939f8bf8be02612a438db83e6 (diff) | |
download | nautilus-e5e14eef9e44659a4d8bb22b33adb3e4afeb2453.tar.gz |
window-slot: show actionbar
When we change the view, add the view's actionbar
to the bottom of the window slot.
https://bugzilla.gnome.org/show_bug.cgi?id=767874
-rw-r--r-- | src/nautilus-window-slot.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c index 76cfeef2e..d35b50b08 100644 --- a/src/nautilus-window-slot.c +++ b/src/nautilus-window-slot.c @@ -2317,8 +2317,20 @@ 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 @@ -2336,6 +2348,16 @@ 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 |