[nautilus/gnome-3-22] window-slot: reverse the view icon action



commit bb5fc8cfc91b2bcae29294605c967c776df20893
Author: Carlos Soriano <csoriano gnome org>
Date:   Mon Nov 14 14:57:23 2016 +0100

    window-slot: reverse the view icon action
    
    That means, now we will show the grid icon when the current view is
    the list view and the opposite.
    
    This goes in similarity with gnome-boxes.
    
    The main question to decide this is, is the button an action, and
    therefore the icon should be the "target" of the action, or is more
    about an information of the current state, and therefore the icon should
    be about the current view type?
    
    This patch decides the icon represents an action, although would be good
    to have some user testing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771075

 src/nautilus-window-slot.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index c680ba3..a9fb749 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -3050,13 +3050,27 @@ nautilus_window_slot_get_icon (NautilusWindowSlot *self)
     }
 
     current_view_id = nautilus_view_get_view_id (NAUTILUS_VIEW (priv->content_view));
-    if (current_view_id != NAUTILUS_VIEW_INVALID_ID)
+    switch (current_view_id)
     {
-        return nautilus_view_get_icon (current_view_id);
-    }
-    else
-    {
-        return NULL;
+        case NAUTILUS_VIEW_LIST_ID:
+        {
+            return nautilus_view_get_icon (NAUTILUS_VIEW_GRID_ID);
+        }
+        break;
+        case NAUTILUS_VIEW_GRID_ID:
+        {
+            return nautilus_view_get_icon (NAUTILUS_VIEW_LIST_ID);
+        }
+        break;
+        case NAUTILUS_VIEW_OTHER_LOCATIONS_ID:
+        {
+            return nautilus_view_get_icon (NAUTILUS_VIEW_OTHER_LOCATIONS_ID);
+        }
+        break;
+        default:
+        {
+            return NULL;
+        }
     }
 }
 


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