[nautilus] toolbar: don't explicitly show/hide visible columns menu items



commit 6345811b4764e29ccee1b334104ab9e78a9880e4
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Jan 25 12:44:25 2015 +0000

    toolbar: don't explicitly show/hide visible columns menu items
    
    Look at whether the action exists in the view action group instead.

 src/nautilus-list-view.c |    2 --
 src/nautilus-toolbar.c   |   10 +++-------
 src/nautilus-toolbar.h   |    1 -
 3 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 19af23b..4192c79 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -3064,8 +3064,6 @@ nautilus_list_view_update_toolbar_menus (NautilusView *view)
        toolbar = NAUTILUS_TOOLBAR (nautilus_window_get_toolbar (nautilus_view_get_window (view)));
        nautilus_toolbar_view_menu_widget_set_zoom_level (toolbar,
                                                          (gdouble) list_view->details->zoom_level);
-
-       nautilus_toolbar_show_visible_columns (toolbar);
 }
 
 static void
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index 5cce59d..0c0244b 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -611,10 +611,12 @@ nautilus_toolbar_reset_menus (NautilusToolbar *self)
                                        "view",
                                        G_ACTION_GROUP (view_action_group));
 
+       gtk_widget_set_visible (self->priv->visible_columns,
+                               g_action_group_has_action (view_action_group, "visible-columns"));
+
        gtk_widget_hide (self->priv->sort_menu);
        gtk_widget_hide (self->priv->sort_trash_time);
        gtk_widget_hide (self->priv->sort_search_relevance);
-       gtk_widget_hide (self->priv->visible_columns);
 }
 
 void
@@ -636,12 +638,6 @@ nautilus_toolbar_show_sort_search_relevance (NautilusToolbar *self)
 }
 
 void
-nautilus_toolbar_show_visible_columns (NautilusToolbar *self)
-{
-       gtk_widget_show (self->priv->visible_columns);
-}
-
-void
 nautilus_toolbar_view_menu_widget_set_zoom_level (NautilusToolbar *self,
                                                  gdouble          level)
 {
diff --git a/src/nautilus-toolbar.h b/src/nautilus-toolbar.h
index 9acf3f9..8d18304 100644
--- a/src/nautilus-toolbar.h
+++ b/src/nautilus-toolbar.h
@@ -86,6 +86,5 @@ void nautilus_toolbar_update_view_mode (NautilusToolbar *self,
 void nautilus_toolbar_show_sort_menu (NautilusToolbar *self);
 void nautilus_toolbar_show_sort_trash_time (NautilusToolbar *self);
 void nautilus_toolbar_show_sort_search_relevance (NautilusToolbar *self);
-void nautilus_toolbar_show_visible_columns (NautilusToolbar *self);
 
 #endif /* __NAUTILUS_TOOLBAR_H__ */


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