[nautilus/wip/gbsneto/actionbar: 9/10] window-slot: show actionbar



commit 07f2884de14c41df4669fc12594dbc88c77bd760
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Mar 2 01:03:25 2016 -0300

    window-slot: show actionbar
    
    When we change the view, add the view's actionbar
    to the bottom of the window slot.

 src/nautilus-window-slot.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 5af90d6..86a0d4b 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -2204,6 +2204,19 @@ done:
 static void
 change_view (NautilusWindowSlot *slot)
 {
+        NautilusView *view;
+        gboolean view_changed;
+
+        view = slot->details->new_content_view;
+        view_changed = slot->details->content_view != view;
+
+        /* Remove the old actionbar before switching to the new view */
+        if (view_changed &&
+            slot->details->content_view &&
+            nautilus_view_get_action_bar (slot->details->content_view)) {
+                gtk_container_remove (GTK_CONTAINER (slot), nautilus_view_get_action_bar 
(slot->details->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
@@ -2221,6 +2234,16 @@ change_view (NautilusWindowSlot *slot)
         * add back the extra location widgets.
         */
        nautilus_window_slot_setup_extra_location_widgets (slot);
+
+        /* 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 (slot), actionbar, FALSE, FALSE, 0);
+                gtk_widget_show (actionbar);
+        }
 }
 
 static void


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