[nautilus] window-slot: reverse the view icon action
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] window-slot: reverse the view icon action
- Date: Wed, 23 Nov 2016 12:02:51 +0000 (UTC)
commit 9a261eb1bb21e74a85542d420bb678d8530791ae
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 e8143b6..262395c 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;
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]