Re: [patch] change calculation of font size in list view/zoom levels discussion



Dave Camp wrote:
>
> I think the way we handle fonts now is probably the best balance of
> attractiveness and usability.  We use the system font size at the
> default zoom level, so that most of the time the user gets a size we
> know he is comfortable reading.  Changes to that font size need to be
> explicitly requested by changing the zoom level.
> 
> Given that requirement, the only thing that makes sense when zooming is
> to scale relative to that default font size.  We might need to tweak the
> scale factors for the different zoom levels, I don't know.

The scaling intervals we currently use don't match the intervals the 
icons get scaled with.
This new version of my patch displays the default font (size) with the default 
zoomlevel, but still scales the icons as much as the icon gets scaled.
After considering cons and pros, I removed the part about using as much 
height as  available; this had some nice results, but it hurted 
consistency across the desktop and within the nautilus window.
It's better to use the default font(size) with the default scalefactor. 
I guess that's why these settings are called "default" :-)


Marten
Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.198
diff -u -r1.198 fm-list-view.c
--- src/file-manager/fm-list-view.c	28 Mar 2003 11:28:39 -0000	1.198
+++ src/file-manager/fm-list-view.c	31 Mar 2003 22:34:03 -0000
@@ -999,38 +999,28 @@
 			      NautilusZoomLevel new_level,
 			      gboolean update_size_table)
 {
-	static gboolean first_time = TRUE;
-	static double pango_scale[7];
-	int default_zoom_level, i;
-
+	int current_icon_size, default_icon_size;
+	float scale_factor;
+	
 	g_return_if_fail (new_level >= NAUTILUS_ZOOM_LEVEL_SMALLEST &&
 			  new_level <= NAUTILUS_ZOOM_LEVEL_LARGEST);
 
-	if (update_size_table || first_time) {
-		first_time = FALSE;
+	current_icon_size = nautilus_get_icon_size_for_zoom_level(new_level);
+	default_icon_size = nautilus_get_icon_size_for_zoom_level(get_default_zoom_level());
 
-		default_zoom_level = get_default_zoom_level ();
+	scale_factor = ((float)current_icon_size / (float)default_icon_size);
 
-		pango_scale[default_zoom_level] = PANGO_SCALE_MEDIUM;
-		for (i = default_zoom_level; i > NAUTILUS_ZOOM_LEVEL_SMALLEST; i--) {
-			pango_scale[i - 1] = (1 / 1.2) * pango_scale[i];
-		}
-		for (i = default_zoom_level; i < NAUTILUS_ZOOM_LEVEL_LARGEST; i++) {
-			pango_scale[i + 1] = 1.2 * pango_scale[i];
-		}
-	}
-					 
 	g_object_set (G_OBJECT (view->details->file_name_cell),
-		      "scale", pango_scale[new_level],
+		      "scale", scale_factor, 
 		      NULL);
 	g_object_set (G_OBJECT (view->details->size_cell),
-		      "scale", pango_scale[new_level],
+		      "scale", scale_factor,
 		      NULL);
 	g_object_set (G_OBJECT (view->details->type_cell),
-		      "scale", pango_scale[new_level],
+		      "scale", scale_factor,
 		      NULL);
 	g_object_set (G_OBJECT (view->details->date_modified_cell),
-		      "scale", pango_scale[new_level],
+		      "scale", scale_factor,
 		      NULL);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]