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:04:31 +0100
commit4283c2acf9286b463ab6c3f858fd266ff5d18368 (patch)
treeaf0126acd0e5142820fbaf17934eb8dbd4bb49ba
parentb953d31eb3ebc2b175d256fe01e3575216076c6c (diff)
downloadnautilus-4283c2acf9286b463ab6c3f858fd266ff5d18368.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 c680ba301..a9fb749e6 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;
+ }
}
}