summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-11-14 14:57:23 +0100
committerCarlos Soriano <csoriano@gnome.org>2016-11-23 13:02:29 +0100
commit9a261eb1bb21e74a85542d420bb678d8530791ae (patch)
treed149c6b5f5f08ae6adad580a40baa6623abd5256
parent88cee3926a95150099f479cc16487ba01d6c8520 (diff)
downloadnautilus-9a261eb1bb21e74a85542d420bb678d8530791ae.tar.gz
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
-rw-r--r--src/nautilus-window-slot.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index e8143b63e..262395c93 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -3088,13 +3088,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;
+ }
}
}