[nautilus/gnome-3-20] files-view: make sort and zoom widgets insensitive on empty directory



commit a3e008c6c656861148383147e4ae63108f6cac74
Author: Carlos Soriano <csoriano gnome org>
Date:   Mon Mar 14 22:16:11 2016 +0100

    files-view: make sort and zoom widgets insensitive on empty directory
    
    It's confusing to have widgets that does nothing. Make them insensitive
    in case the view is empty.

 src/nautilus-files-view.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index af8af23..c2c5bb8 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -6857,6 +6857,14 @@ nautilus_files_view_reset_view_menu (NautilusFilesView *view)
         show_sort_trash = show_sort_search = show_sort_modification = show_sort_access = FALSE;
         gtk_widget_set_visible (view->details->sort_menu, sort_available);
 
+        /* We want to make insensitive available actions but that are not current
+         * available due to the directory
+         */
+        gtk_widget_set_sensitive (view->details->sort_menu,
+                                  !nautilus_files_view_is_empty (view));
+        gtk_widget_set_sensitive (view->details->zoom_level_scale,
+                                  !nautilus_files_view_is_empty (view));
+
         if (sort_available) {
                 variant = g_action_group_get_action_state_hint (view_action_group, "sort");
                 g_variant_iter_init (&iter, variant);


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