[nautilus/wip/gaction: 1/2] nautilus-icon-info: Change zoom levels
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/gaction: 1/2] nautilus-icon-info: Change zoom levels
- Date: Thu, 20 Nov 2014 14:38:00 +0000 (UTC)
commit 83f75afaa602df5f5870f70837cf9ed87e93a226
Author: Carlos Soriano <carlos sorian89 gmail com>
Date: Thu Nov 20 13:38:33 2014 +0100
nautilus-icon-info: Change zoom levels
Following a design request and preparing to the port to popovers of
nautilus, we want to use only 3 zoom levels, so the slider makes sense.
Also, following design guidelines, the new zoom levels sizes are
64, 96, 128, with default to 96.
libnautilus-private/nautilus-canvas-container.c | 4 ----
.../nautilus-file-conflict-dialog.c | 8 ++++----
libnautilus-private/nautilus-icon-info.c | 8 --------
libnautilus-private/nautilus-icon-info.h | 16 ++++------------
.../org.gnome.nautilus.gschema.xml.in | 10 +++-------
src/nautilus-bookmarks-window.c | 2 +-
src/nautilus-canvas-view-container.c | 18 ++++--------------
src/nautilus-list-model.c | 16 ----------------
8 files changed, 16 insertions(+), 66 deletions(-)
---
diff --git a/libnautilus-private/nautilus-canvas-container.c b/libnautilus-private/nautilus-canvas-container.c
index 03c8e7d..8c92748 100644
--- a/libnautilus-private/nautilus-canvas-container.c
+++ b/libnautilus-private/nautilus-canvas-container.c
@@ -5192,11 +5192,7 @@ get_text_ellipsis_limit_for_zoom (char **strs,
static const char * zoom_level_names[] = {
"smallest",
- "smaller",
- "small",
"standard",
- "large",
- "larger",
"largest"
};
diff --git a/libnautilus-private/nautilus-file-conflict-dialog.c
b/libnautilus-private/nautilus-file-conflict-dialog.c
index 7fcb2d6..c6c1115 100644
--- a/libnautilus-private/nautilus-file-conflict-dialog.c
+++ b/libnautilus-private/nautilus-file-conflict-dialog.c
@@ -74,7 +74,7 @@ file_icons_changed (NautilusFile *file,
GdkPixbuf *pixbuf;
pixbuf = nautilus_file_get_icon_pixbuf (fcd->details->destination,
- NAUTILUS_ICON_SIZE_LARGE,
+ NAUTILUS_ICON_SIZE_STANDARD,
TRUE,
gtk_widget_get_scale_factor (fcd->details->dest_image),
NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS);
@@ -83,7 +83,7 @@ file_icons_changed (NautilusFile *file,
g_object_unref (pixbuf);
pixbuf = nautilus_file_get_icon_pixbuf (fcd->details->source,
- NAUTILUS_ICON_SIZE_LARGE,
+ NAUTILUS_ICON_SIZE_STANDARD,
TRUE,
gtk_widget_get_scale_factor (fcd->details->src_image),
NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS);
@@ -219,7 +219,7 @@ file_list_ready_cb (GList *files,
/* Set up file icons */
pixbuf = nautilus_file_get_icon_pixbuf (dest,
- NAUTILUS_ICON_SIZE_LARGE,
+ NAUTILUS_ICON_SIZE_STANDARD,
TRUE,
gtk_widget_get_scale_factor (fcd->details->titles_vbox),
NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS);
@@ -230,7 +230,7 @@ file_list_ready_cb (GList *files,
g_object_unref (pixbuf);
pixbuf = nautilus_file_get_icon_pixbuf (src,
- NAUTILUS_ICON_SIZE_LARGE,
+ NAUTILUS_ICON_SIZE_STANDARD,
TRUE,
gtk_widget_get_scale_factor (fcd->details->titles_vbox),
NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS);
diff --git a/libnautilus-private/nautilus-icon-info.c b/libnautilus-private/nautilus-icon-info.c
index c272803..5fa8b0d 100644
--- a/libnautilus-private/nautilus-icon-info.c
+++ b/libnautilus-private/nautilus-icon-info.c
@@ -580,16 +580,8 @@ nautilus_get_icon_size_for_zoom_level (NautilusZoomLevel zoom_level)
switch (zoom_level) {
case NAUTILUS_ZOOM_LEVEL_SMALLEST:
return NAUTILUS_ICON_SIZE_SMALLEST;
- case NAUTILUS_ZOOM_LEVEL_SMALLER:
- return NAUTILUS_ICON_SIZE_SMALLER;
- case NAUTILUS_ZOOM_LEVEL_SMALL:
- return NAUTILUS_ICON_SIZE_SMALL;
case NAUTILUS_ZOOM_LEVEL_STANDARD:
return NAUTILUS_ICON_SIZE_STANDARD;
- case NAUTILUS_ZOOM_LEVEL_LARGE:
- return NAUTILUS_ICON_SIZE_LARGE;
- case NAUTILUS_ZOOM_LEVEL_LARGER:
- return NAUTILUS_ICON_SIZE_LARGER;
case NAUTILUS_ZOOM_LEVEL_LARGEST:
return NAUTILUS_ICON_SIZE_LARGEST;
}
diff --git a/libnautilus-private/nautilus-icon-info.h b/libnautilus-private/nautilus-icon-info.h
index e8446ec..652e099 100644
--- a/libnautilus-private/nautilus-icon-info.h
+++ b/libnautilus-private/nautilus-icon-info.h
@@ -12,12 +12,8 @@ G_BEGIN_DECLS
/* Names for Nautilus's different zoom levels, from tiniest items to largest items */
typedef enum {
NAUTILUS_ZOOM_LEVEL_SMALLEST,
- NAUTILUS_ZOOM_LEVEL_SMALLER,
- NAUTILUS_ZOOM_LEVEL_SMALL,
NAUTILUS_ZOOM_LEVEL_STANDARD,
- NAUTILUS_ZOOM_LEVEL_LARGE,
- NAUTILUS_ZOOM_LEVEL_LARGER,
- NAUTILUS_ZOOM_LEVEL_LARGEST
+ NAUTILUS_ZOOM_LEVEL_LARGEST,
} NautilusZoomLevel;
#define NAUTILUS_ZOOM_LEVEL_N_ENTRIES (NAUTILUS_ZOOM_LEVEL_LARGEST + 1)
@@ -28,13 +24,9 @@ typedef enum {
* be square. Since individual icons can be stretched,
* each icon is not constrained to this nominal size.
*/
-#define NAUTILUS_ICON_SIZE_SMALLEST 16
-#define NAUTILUS_ICON_SIZE_SMALLER 24
-#define NAUTILUS_ICON_SIZE_SMALL 32
-#define NAUTILUS_ICON_SIZE_STANDARD 48
-#define NAUTILUS_ICON_SIZE_LARGE 72
-#define NAUTILUS_ICON_SIZE_LARGER 96
-#define NAUTILUS_ICON_SIZE_LARGEST 192
+#define NAUTILUS_ICON_SIZE_SMALLEST 64
+#define NAUTILUS_ICON_SIZE_STANDARD 96
+#define NAUTILUS_ICON_SIZE_LARGEST 128
/* Maximum size of an icon that the icon factory will ever produce */
#define NAUTILUS_ICON_MAXIMUM_SIZE 320
diff --git a/libnautilus-private/org.gnome.nautilus.gschema.xml.in
b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
index ba344a2..1148898 100644
--- a/libnautilus-private/org.gnome.nautilus.gschema.xml.in
+++ b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
@@ -33,12 +33,8 @@
<enum id="org.gnome.nautilus.ZoomLevel">
<value nick="smallest" value="0"/>
- <value nick="smaller" value="1"/>
- <value nick="small" value="2"/>
- <value nick="standard" value="3"/>
- <value nick="large" value="4"/>
- <value nick="larger" value="5"/>
- <value nick="largest" value="6"/>
+ <value nick="standard" value="1"/>
+ <value nick="largest" value="2"/>
</enum>
<enum id="org.gnome.nautilus.TabPosition">
@@ -213,7 +209,7 @@
<schema id="org.gnome.nautilus.list-view" path="/org/gnome/nautilus/list-view/" gettext-domain="nautilus">
<key name="default-zoom-level" enum="org.gnome.nautilus.ZoomLevel">
- <default>'small'</default>
+ <default>'smallest'</default>
<_summary>Default list zoom level</_summary>
<_description>Default zoom level used by the list view.</_description>
</key>
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index ad4393b..9a1329c 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -743,7 +743,7 @@ nautilus_bookmarks_window_constructed (GObject *object)
gtk_tree_view_append_column (self->priv->tree_view,
GTK_TREE_VIEW_COLUMN (col));
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (col),
- NAUTILUS_ICON_SIZE_SMALLER);
+ NAUTILUS_ICON_SIZE_SMALLEST);
rend = gtk_cell_renderer_text_new ();
g_object_set (rend,
diff --git a/src/nautilus-canvas-view-container.c b/src/nautilus-canvas-view-container.c
index 09e3ce6..77df2f0 100644
--- a/src/nautilus-canvas-view-container.c
+++ b/src/nautilus-canvas-view-container.c
@@ -218,13 +218,9 @@ nautilus_canvas_view_container_get_icon_text_attribute_names (NautilusCanvasCont
int piece_count;
const int pieces_by_level[] = {
- 0, /* NAUTILUS_ZOOM_LEVEL_SMALLEST */
- 0, /* NAUTILUS_ZOOM_LEVEL_SMALLER */
- 0, /* NAUTILUS_ZOOM_LEVEL_SMALL */
+ 1, /* NAUTILUS_ZOOM_LEVEL_SMALLEST */
1, /* NAUTILUS_ZOOM_LEVEL_STANDARD */
- 2, /* NAUTILUS_ZOOM_LEVEL_LARGE */
- 2, /* NAUTILUS_ZOOM_LEVEL_LARGER */
- 3 /* NAUTILUS_ZOOM_LEVEL_LARGEST */
+ 1 /* NAUTILUS_ZOOM_LEVEL_LARGEST */
};
piece_count = pieces_by_level[nautilus_canvas_container_get_zoom_level (container)];
@@ -262,14 +258,8 @@ nautilus_canvas_view_container_get_icon_text (NautilusCanvasContainer *container
use_additional = (additional_text != NULL);
- /* In the smallest zoom mode, no text is drawn. */
- if (nautilus_canvas_container_get_zoom_level (container) == NAUTILUS_ZOOM_LEVEL_SMALLEST &&
- !include_invisible) {
- *editable_text = NULL;
- } else {
- /* Strip the suffix for nautilus object xml files. */
- *editable_text = nautilus_file_get_display_name (file);
- }
+ /* Strip the suffix for nautilus object xml files. */
+ *editable_text = nautilus_file_get_display_name (file);
if (!use_additional) {
return;
diff --git a/src/nautilus-list-model.c b/src/nautilus-list-model.c
index 7da5150..a681cfa 100644
--- a/src/nautilus-list-model.c
+++ b/src/nautilus-list-model.c
@@ -1252,16 +1252,8 @@ nautilus_list_model_get_zoom_level_from_column_id (int column)
switch (column) {
case NAUTILUS_LIST_MODEL_SMALLEST_ICON_COLUMN:
return NAUTILUS_ZOOM_LEVEL_SMALLEST;
- case NAUTILUS_LIST_MODEL_SMALLER_ICON_COLUMN:
- return NAUTILUS_ZOOM_LEVEL_SMALLER;
- case NAUTILUS_LIST_MODEL_SMALL_ICON_COLUMN:
- return NAUTILUS_ZOOM_LEVEL_SMALL;
case NAUTILUS_LIST_MODEL_STANDARD_ICON_COLUMN:
return NAUTILUS_ZOOM_LEVEL_STANDARD;
- case NAUTILUS_LIST_MODEL_LARGE_ICON_COLUMN:
- return NAUTILUS_ZOOM_LEVEL_LARGE;
- case NAUTILUS_LIST_MODEL_LARGER_ICON_COLUMN:
- return NAUTILUS_ZOOM_LEVEL_LARGER;
case NAUTILUS_LIST_MODEL_LARGEST_ICON_COLUMN:
return NAUTILUS_ZOOM_LEVEL_LARGEST;
}
@@ -1275,16 +1267,8 @@ nautilus_list_model_get_column_id_from_zoom_level (NautilusZoomLevel zoom_level)
switch (zoom_level) {
case NAUTILUS_ZOOM_LEVEL_SMALLEST:
return NAUTILUS_LIST_MODEL_SMALLEST_ICON_COLUMN;
- case NAUTILUS_ZOOM_LEVEL_SMALLER:
- return NAUTILUS_LIST_MODEL_SMALLER_ICON_COLUMN;
- case NAUTILUS_ZOOM_LEVEL_SMALL:
- return NAUTILUS_LIST_MODEL_SMALL_ICON_COLUMN;
case NAUTILUS_ZOOM_LEVEL_STANDARD:
return NAUTILUS_LIST_MODEL_STANDARD_ICON_COLUMN;
- case NAUTILUS_ZOOM_LEVEL_LARGE:
- return NAUTILUS_LIST_MODEL_LARGE_ICON_COLUMN;
- case NAUTILUS_ZOOM_LEVEL_LARGER:
- return NAUTILUS_LIST_MODEL_LARGER_ICON_COLUMN;
case NAUTILUS_ZOOM_LEVEL_LARGEST:
return NAUTILUS_LIST_MODEL_LARGEST_ICON_COLUMN;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]