[nautilus/wip/gaction: 19/20] 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: 19/20] nautilus-icon-info: Change zoom levels
- Date: Wed, 10 Dec 2014 16:37:12 +0000 (UTC)
commit 90a6ba29f52fc400a49822553c317e549159a911
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 | 3 +--
libnautilus-private/nautilus-canvas-item.c | 4 +++-
.../nautilus-file-conflict-dialog.c | 8 ++++----
libnautilus-private/nautilus-icon-info.c | 2 --
libnautilus-private/nautilus-icon-info.h | 8 +++-----
.../org.gnome.nautilus.gschema.xml.in | 17 ++++++++---------
src/nautilus-application.c | 16 +++++++---------
src/nautilus-bookmarks-window.c | 2 +-
src/nautilus-canvas-view-container.c | 19 ++++++-------------
src/nautilus-canvas-view.c | 14 +++++---------
src/nautilus-list-model.c | 6 ------
src/nautilus-list-model.h | 1 -
src/nautilus-list-view.c | 8 ++++----
13 files changed, 42 insertions(+), 66 deletions(-)
---
diff --git a/libnautilus-private/nautilus-canvas-container.c b/libnautilus-private/nautilus-canvas-container.c
index 03c8e7d..c9f9093 100644
--- a/libnautilus-private/nautilus-canvas-container.c
+++ b/libnautilus-private/nautilus-canvas-container.c
@@ -95,7 +95,7 @@
#define CONTAINER_PAD_TOP 4
#define CONTAINER_PAD_BOTTOM 4
-#define STANDARD_ICON_GRID_WIDTH 155
+#define STANDARD_ICON_GRID_WIDTH 80
/* Desktop layout mode defines */
#define DESKTOP_PAD_HORIZONTAL 10
@@ -5192,7 +5192,6 @@ get_text_ellipsis_limit_for_zoom (char **strs,
static const char * zoom_level_names[] = {
"smallest",
- "smaller",
"small",
"standard",
"large",
diff --git a/libnautilus-private/nautilus-canvas-item.c b/libnautilus-private/nautilus-canvas-item.c
index 7e5d542..7df4d1e 100644
--- a/libnautilus-private/nautilus-canvas-item.c
+++ b/libnautilus-private/nautilus-canvas-item.c
@@ -49,7 +49,9 @@
#define LABEL_OFFSET 1
#define LABEL_LINE_SPACING 0
-#define MAX_TEXT_WIDTH_STANDARD 135
+/* Width of the label with the standard icon size NAUTILUS_ICON_SIZE_STANDARD.
+ * It will adapt to other sizes keeping the same space.*/
+#define MAX_TEXT_WIDTH_STANDARD 70
/* special text height handling
* each item has three text height variables:
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..06f6d86 100644
--- a/libnautilus-private/nautilus-icon-info.c
+++ b/libnautilus-private/nautilus-icon-info.c
@@ -580,8 +580,6 @@ 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:
diff --git a/libnautilus-private/nautilus-icon-info.h b/libnautilus-private/nautilus-icon-info.h
index e8446ec..0fa611d 100644
--- a/libnautilus-private/nautilus-icon-info.h
+++ b/libnautilus-private/nautilus-icon-info.h
@@ -12,12 +12,11 @@ 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)
@@ -29,12 +28,11 @@ typedef enum {
* 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_LARGE 64
#define NAUTILUS_ICON_SIZE_LARGER 96
-#define NAUTILUS_ICON_SIZE_LARGEST 192
+#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..f50b00e 100644
--- a/libnautilus-private/org.gnome.nautilus.gschema.xml.in
+++ b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
@@ -33,12 +33,11 @@
<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="small" value="1"/>
+ <value nick="standard" value="2"/>
+ <value nick="large" value="3"/>
+ <value nick="larger" value="4"/>
+ <value nick="largest" value="5"/>
</enum>
<enum id="org.gnome.nautilus.TabPosition">
@@ -177,14 +176,14 @@
"group", "permissions", and "mime_type".</_description>
</key>
<key name="default-zoom-level" enum="org.gnome.nautilus.ZoomLevel">
- <default>'standard'</default>
+ <default>'larger'</default>
<_summary>Default icon zoom level</_summary>
<_description>Default zoom level used by the icon view.</_description>
</key>
<key name="thumbnail-size" type="i">
- <default>64</default>
+ <default>48</default>
<_summary>Default Thumbnail Icon Size</_summary>
- <_description>The default size of an icon for a thumbnail in the icon view.</_description>
+ <_description>The default size of an icon for a thumbnail in the icon view when using
NAUTILUS_ICON_SIZE_STANDARD size.</_description>
</key>
<key name="text-ellipsis-limit" type="as">
<default>[ '3' ]</default>
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index a768e52..1460e31 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -866,7 +866,13 @@ nautilus_application_handle_local_options (GApplication *application,
goto out;
}
- if (g_variant_dict_contains (options, "force-desktop")) {
+ if (g_variant_dict_contains (options, "no-default-window")) {
+ /* We want to avoid trigering the activate signal; so no window is created.
+ * GApplication doesn't call activate if we return a value >= 0.
+ * Use EXIT_SUCCESS since is >= 0. */
+ retval = EXIT_SUCCESS;
+ goto out;
+ } else if (g_variant_dict_contains (options, "force-desktop")) {
DEBUG ("Forcing desktop, as requested");
self->priv->desktop_override = TRUE;
g_action_group_activate_action (G_ACTION_GROUP (application),
@@ -878,14 +884,6 @@ nautilus_application_handle_local_options (GApplication *application,
"close-desktop", NULL);
}
- if (g_variant_dict_contains (options, "no-default-window")) {
- /* We want to avoid trigering the activate signal; so no window is created.
- * GApplication doesn't call activate if we return a value >= 0.
- * Use EXIT_SUCCESS since is >= 0. */
- retval = EXIT_SUCCESS;
- goto out;
- }
-
retval = nautilus_application_handle_file_args (self, options);
out:
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..4257f69 100644
--- a/src/nautilus-canvas-view-container.c
+++ b/src/nautilus-canvas-view-container.c
@@ -219,12 +219,11 @@ nautilus_canvas_view_container_get_icon_text_attribute_names (NautilusCanvasCont
const int pieces_by_level[] = {
0, /* NAUTILUS_ZOOM_LEVEL_SMALLEST */
- 0, /* NAUTILUS_ZOOM_LEVEL_SMALLER */
- 0, /* NAUTILUS_ZOOM_LEVEL_SMALL */
+ 1, /* NAUTILUS_ZOOM_LEVEL_SMALL */
1, /* NAUTILUS_ZOOM_LEVEL_STANDARD */
- 2, /* NAUTILUS_ZOOM_LEVEL_LARGE */
- 2, /* NAUTILUS_ZOOM_LEVEL_LARGER */
- 3 /* NAUTILUS_ZOOM_LEVEL_LARGEST */
+ 1, /* NAUTILUS_ZOOM_LEVEL_LARGE */
+ 1, /* NAUTILUS_ZOOM_LEVEL_LARGER */
+ 1 /* NAUTILUS_ZOOM_LEVEL_LARGEST */
};
piece_count = pieces_by_level[nautilus_canvas_container_get_zoom_level (container)];
@@ -262,14 +261,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-canvas-view.c b/src/nautilus-canvas-view.c
index c3dad37..ad23629 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -784,7 +784,7 @@ get_default_zoom_level (NautilusCanvasView *canvas_view)
default_zoom_level = g_settings_get_enum (nautilus_icon_view_preferences,
NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL);
- return CLAMP (DEFAULT_ZOOM_LEVEL(canvas_view), NAUTILUS_ZOOM_LEVEL_SMALLEST,
NAUTILUS_ZOOM_LEVEL_LARGEST);
+ return CLAMP (DEFAULT_ZOOM_LEVEL(canvas_view), NAUTILUS_ZOOM_LEVEL_LARGE,
NAUTILUS_ZOOM_LEVEL_LARGEST);
}
static void
@@ -875,7 +875,7 @@ nautilus_canvas_view_end_loading (NautilusView *view,
static NautilusZoomLevel
nautilus_canvas_view_get_zoom_level (NautilusView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), NAUTILUS_ZOOM_LEVEL_STANDARD);
+ g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), NAUTILUS_ZOOM_LEVEL_LARGER);
return nautilus_canvas_container_get_zoom_level (get_canvas_container (NAUTILUS_CANVAS_VIEW (view)));
}
@@ -888,7 +888,7 @@ nautilus_canvas_view_set_zoom_level (NautilusCanvasView *view,
NautilusCanvasContainer *canvas_container;
g_return_if_fail (NAUTILUS_IS_CANVAS_VIEW (view));
- g_return_if_fail (new_level >= NAUTILUS_ZOOM_LEVEL_SMALLEST &&
+ g_return_if_fail (new_level >= NAUTILUS_ZOOM_LEVEL_LARGE &&
new_level <= NAUTILUS_ZOOM_LEVEL_LARGEST);
canvas_container = get_canvas_container (view);
@@ -917,7 +917,7 @@ nautilus_canvas_view_bump_zoom_level (NautilusView *view, int zoom_increment)
new_level = nautilus_canvas_view_get_zoom_level (view) + zoom_increment;
- if (new_level >= NAUTILUS_ZOOM_LEVEL_SMALLEST &&
+ if (new_level >= NAUTILUS_ZOOM_LEVEL_LARGE &&
new_level <= NAUTILUS_ZOOM_LEVEL_LARGEST) {
nautilus_view_zoom_to_level (view, new_level);
}
@@ -962,7 +962,7 @@ nautilus_canvas_view_can_zoom_out (NautilusView *view)
g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), FALSE);
return nautilus_canvas_view_get_zoom_level (view)
- > NAUTILUS_ZOOM_LEVEL_SMALLEST;
+ > NAUTILUS_ZOOM_LEVEL_LARGE;
}
static gboolean
@@ -1083,10 +1083,6 @@ layout_changed_callback (NautilusCanvasContainer *container,
static gboolean
nautilus_canvas_view_can_rename_file (NautilusView *view, NautilusFile *file)
{
- if (!(nautilus_canvas_view_get_zoom_level (view) > NAUTILUS_ZOOM_LEVEL_SMALLEST)) {
- return FALSE;
- }
-
return NAUTILUS_VIEW_CLASS(nautilus_canvas_view_parent_class)->can_rename_file (view, file);
}
diff --git a/src/nautilus-list-model.c b/src/nautilus-list-model.c
index 7da5150..5bf3732 100644
--- a/src/nautilus-list-model.c
+++ b/src/nautilus-list-model.c
@@ -145,7 +145,6 @@ nautilus_list_model_get_column_type (GtkTreeModel *tree_model, int index)
case NAUTILUS_LIST_MODEL_SUBDIRECTORY_COLUMN:
return NAUTILUS_TYPE_DIRECTORY;
case NAUTILUS_LIST_MODEL_SMALLEST_ICON_COLUMN:
- case NAUTILUS_LIST_MODEL_SMALLER_ICON_COLUMN:
case NAUTILUS_LIST_MODEL_SMALL_ICON_COLUMN:
case NAUTILUS_LIST_MODEL_STANDARD_ICON_COLUMN:
case NAUTILUS_LIST_MODEL_LARGE_ICON_COLUMN:
@@ -284,7 +283,6 @@ nautilus_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int
g_value_set_object (value, file_entry->subdirectory);
break;
case NAUTILUS_LIST_MODEL_SMALLEST_ICON_COLUMN:
- case NAUTILUS_LIST_MODEL_SMALLER_ICON_COLUMN:
case NAUTILUS_LIST_MODEL_SMALL_ICON_COLUMN:
case NAUTILUS_LIST_MODEL_STANDARD_ICON_COLUMN:
case NAUTILUS_LIST_MODEL_LARGE_ICON_COLUMN:
@@ -1252,8 +1250,6 @@ 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:
@@ -1275,8 +1271,6 @@ 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:
diff --git a/src/nautilus-list-model.h b/src/nautilus-list-model.h
index 7169a7a..c1631e1 100644
--- a/src/nautilus-list-model.h
+++ b/src/nautilus-list-model.h
@@ -46,7 +46,6 @@ enum {
NAUTILUS_LIST_MODEL_FILE_COLUMN,
NAUTILUS_LIST_MODEL_SUBDIRECTORY_COLUMN,
NAUTILUS_LIST_MODEL_SMALLEST_ICON_COLUMN,
- NAUTILUS_LIST_MODEL_SMALLER_ICON_COLUMN,
NAUTILUS_LIST_MODEL_SMALL_ICON_COLUMN,
NAUTILUS_LIST_MODEL_STANDARD_ICON_COLUMN,
NAUTILUS_LIST_MODEL_LARGE_ICON_COLUMN,
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index b361734..ba8f563 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -2309,7 +2309,7 @@ get_default_zoom_level (void) {
NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL);
if (default_zoom_level < NAUTILUS_ZOOM_LEVEL_SMALLEST
- || NAUTILUS_ZOOM_LEVEL_LARGEST < default_zoom_level) {
+ || default_zoom_level > NAUTILUS_ZOOM_LEVEL_STANDARD) {
default_zoom_level = NAUTILUS_ZOOM_LEVEL_SMALL;
}
@@ -3127,7 +3127,7 @@ nautilus_list_view_set_zoom_level (NautilusListView *view,
g_return_if_fail (NAUTILUS_IS_LIST_VIEW (view));
g_return_if_fail (new_level >= NAUTILUS_ZOOM_LEVEL_SMALLEST &&
- new_level <= NAUTILUS_ZOOM_LEVEL_LARGEST);
+ new_level <= NAUTILUS_ZOOM_LEVEL_STANDARD);
if (view->details->zoom_level == new_level) {
if (always_emit) {
@@ -3163,7 +3163,7 @@ nautilus_list_view_bump_zoom_level (NautilusView *view, int zoom_increment)
new_level = list_view->details->zoom_level + zoom_increment;
if (new_level >= NAUTILUS_ZOOM_LEVEL_SMALLEST &&
- new_level <= NAUTILUS_ZOOM_LEVEL_LARGEST) {
+ new_level <= NAUTILUS_ZOOM_LEVEL_STANDARD) {
nautilus_list_view_set_zoom_level (list_view, new_level, FALSE);
}
}
@@ -3210,7 +3210,7 @@ nautilus_list_view_can_zoom_in (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_LIST_VIEW (view), FALSE);
- return NAUTILUS_LIST_VIEW (view)->details->zoom_level < NAUTILUS_ZOOM_LEVEL_LARGEST;
+ return NAUTILUS_LIST_VIEW (view)->details->zoom_level < NAUTILUS_ZOOM_LEVEL_STANDARD;
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]