Last minute list view fixes...



Well, I guess I have about ten minutes to commit this before the freeze
takes effect in NY.

BTW, I don't need to commit the text view change if there is any doubt (it
is sort of a vi vs. emacs type preference anyway)
? help/nautilus-user-manual/C/nautilus-user-manual-C.omf.out
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.5361
diff -u -p -r1.5361 ChangeLog
--- ChangeLog	3 Jun 2002 23:13:28 -0000	1.5361
+++ ChangeLog	4 Jun 2002 03:42:37 -0000
@@ -1,3 +1,21 @@
+2002-06-03  David Emory Watson  <dwatson cs ucr edu>
+
+	* src/file-manager/fm-list-view.c:
+	(get_derfault_zoom_level): New, protects us from illegal preferences.
+	(set_zoom_level_from_metadata_and_preferences),
+	(fm_list_view_reset_to_defaults),
+	(fm_list_view_set_zoom_level),
+	(fm_list_view_restore_default_zoom_level): Update.
+	(fm_list_view_scale_font_size): Replace switch with loop and always
+	use default font at default zoom level.
+	(click_policy_changed_callback): Make underlines appear or disappear
+	when the click policy changes.
+
+2002-06-02  David Emory Watson  <dwatson cs ucr edu>
+
+	* components/text/nautilus-text-view.c:
+	(nautilus_text_view_instance_init): Turn on word wrapping.
+
 === nautilus 1.1.19 ===
  
 2002-06-03  Alex Larsson  <alexl redhat com>
Index: components/text/nautilus-text-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/text/nautilus-text-view.c,v
retrieving revision 1.53
diff -u -p -r1.53 nautilus-text-view.c
--- components/text/nautilus-text-view.c	9 May 2002 20:49:46 -0000	1.53
+++ components/text/nautilus-text-view.c	4 Jun 2002 03:42:41 -0000
@@ -186,6 +186,7 @@ nautilus_text_view_instance_init (Nautil
         
         text_view = gtk_text_view_new ();
         gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
+        gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD);
 
         scrolled_window = gtk_scrolled_window_new (NULL, NULL);
         gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.175
diff -u -p -r1.175 fm-list-view.c
--- src/file-manager/fm-list-view.c	3 Jun 2002 21:16:17 -0000	1.175
+++ src/file-manager/fm-list-view.c	4 Jun 2002 03:43:03 -0000
@@ -424,6 +424,20 @@ list_view_changed_foreach (GtkTreeModel 
 	return FALSE;
 }
 
+static NautilusZoomLevel
+get_default_zoom_level (void) {
+	NautilusZoomLevel default_zoom_level;
+
+	default_zoom_level = default_zoom_level_auto_value;
+
+	if (default_zoom_level <  NAUTILUS_ZOOM_LEVEL_SMALLEST
+	    || NAUTILUS_ZOOM_LEVEL_LARGEST < default_zoom_level) {
+		default_zoom_level = NAUTILUS_ZOOM_LEVEL_SMALL;
+	}
+
+	return default_zoom_level;
+}
+
 static void
 set_zoom_level_from_metadata_and_preferences (FMListView *list_view)
 {
@@ -434,7 +448,7 @@ set_zoom_level_from_metadata_and_prefere
 		file = fm_directory_view_get_directory_as_file (FM_DIRECTORY_VIEW (list_view));
 		level = nautilus_file_get_integer_metadata (file,
 							    NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL, 
-							    default_zoom_level_auto_value);
+							    get_default_zoom_level ());
 		fm_list_view_set_zoom_level (list_view, level, TRUE);
 		
 		/* reset the font size table for the new default zoom level */
@@ -569,99 +583,29 @@ fm_list_view_reset_to_defaults (FMDirect
 		 fm_list_model_get_sort_column_id_from_sort_type (default_sort_order_auto_value),
 		 default_sort_reversed_auto_value ? GTK_SORT_DESCENDING : GTK_SORT_ASCENDING);
 
-	fm_list_view_set_zoom_level (FM_LIST_VIEW (view), default_zoom_level_auto_value, FALSE);
+	fm_list_view_set_zoom_level (FM_LIST_VIEW (view), get_default_zoom_level (), FALSE);
 }
 
 static void
 fm_list_view_scale_font_size (FMListView *view, 
-					NautilusZoomLevel new_level,
-					gboolean update_size_table)
+			      NautilusZoomLevel new_level,
+			      gboolean update_size_table)
 {
 	static gboolean first_time = TRUE;
-	static double pango_scale[7];	
+	static double pango_scale[7];
+	int default_zoom_level, i;
 
 	if (update_size_table || first_time) {
 		first_time = FALSE;
-	
-		switch (default_zoom_level_auto_value)
-		{
-		case NAUTILUS_ZOOM_LEVEL_LARGEST:
-			pango_scale[0] = (1 / 1.2) * (1 / 1.2) * PANGO_SCALE_XX_SMALL;
-			pango_scale[1] = (1 / 1.2) * PANGO_SCALE_XX_SMALL;
-			pango_scale[2] = PANGO_SCALE_XX_SMALL;
-			pango_scale[3] = PANGO_SCALE_X_SMALL;
-			pango_scale[4] = PANGO_SCALE_SMALL;
-			pango_scale[5] = PANGO_SCALE_MEDIUM;
-			pango_scale[6] = PANGO_SCALE_LARGE;
-			break;
-		case NAUTILUS_ZOOM_LEVEL_LARGER:
-			pango_scale[0] = (1 / 1.2) * PANGO_SCALE_XX_SMALL;
-			pango_scale[1] = PANGO_SCALE_XX_SMALL;
-			pango_scale[2] = PANGO_SCALE_X_SMALL;
-			pango_scale[3] = PANGO_SCALE_SMALL;
-			pango_scale[4] = PANGO_SCALE_MEDIUM;
-			pango_scale[5] = PANGO_SCALE_LARGE;
-			pango_scale[6] = PANGO_SCALE_X_LARGE;
-			break;
-		case NAUTILUS_ZOOM_LEVEL_LARGE:
-			pango_scale[0] = PANGO_SCALE_XX_SMALL;
-			pango_scale[1] = PANGO_SCALE_X_SMALL;
-			pango_scale[2] = PANGO_SCALE_SMALL;
-			pango_scale[3] = PANGO_SCALE_MEDIUM;
-			pango_scale[4] = PANGO_SCALE_LARGE;
-			pango_scale[5] = PANGO_SCALE_X_LARGE;
-			pango_scale[6] = PANGO_SCALE_XX_LARGE;
-			break;
-		case NAUTILUS_ZOOM_LEVEL_STANDARD:
-			pango_scale[0] = PANGO_SCALE_X_SMALL;
-			pango_scale[1] = PANGO_SCALE_SMALL;
-			pango_scale[2] = PANGO_SCALE_MEDIUM;
-			pango_scale[3] = PANGO_SCALE_LARGE;
-			pango_scale[4] = PANGO_SCALE_X_LARGE;
-			pango_scale[5] = PANGO_SCALE_XX_LARGE;
-			pango_scale[6] = 1.2 * PANGO_SCALE_XX_LARGE;
-			break;
-		case NAUTILUS_ZOOM_LEVEL_SMALL:
-			pango_scale[0] = PANGO_SCALE_SMALL;
-			pango_scale[1] = PANGO_SCALE_MEDIUM;
-			pango_scale[2] = PANGO_SCALE_LARGE;
-			pango_scale[3] = PANGO_SCALE_X_LARGE;
-			pango_scale[4] = PANGO_SCALE_XX_LARGE;
-			pango_scale[5] = 1.2 * PANGO_SCALE_XX_LARGE;
-			pango_scale[6] = 1.2 * 1.2 * PANGO_SCALE_XX_LARGE;
-			break;
-		case NAUTILUS_ZOOM_LEVEL_SMALLER:
-			/* From here on down we use PANGO_SCALE_MEDIUM for the
-			 * default zoom. Since the icons are now smaller this 
-			 * looks better at default zoom.
-			 */
-			pango_scale[0] = PANGO_SCALE_SMALL;
-			pango_scale[1] = PANGO_SCALE_MEDIUM;
-			pango_scale[2] = PANGO_SCALE_LARGE;
-			pango_scale[3] = PANGO_SCALE_X_LARGE;
-			pango_scale[4] = PANGO_SCALE_XX_LARGE;
-			pango_scale[5] = 1.2 * PANGO_SCALE_XX_LARGE;
-			pango_scale[6] = 1.2 * 1.2 * PANGO_SCALE_XX_LARGE;
-			break;
-		case NAUTILUS_ZOOM_LEVEL_SMALLEST:
-			pango_scale[0] = PANGO_SCALE_MEDIUM;
-			pango_scale[1] = PANGO_SCALE_LARGE;
-			pango_scale[2] = PANGO_SCALE_X_LARGE;
-			pango_scale[3] = PANGO_SCALE_XX_LARGE;
-			pango_scale[4] = 1.2 * PANGO_SCALE_XX_LARGE;
-			pango_scale[5] = 1.2 * 1.2 * PANGO_SCALE_XX_LARGE;
-			pango_scale[6] = 1.2 * 1.2 * 1.2 * PANGO_SCALE_XX_LARGE;
-			break;
-		default:
-			g_warning ("invalid default list-view zoom level");
-			pango_scale[0] = PANGO_SCALE_X_SMALL;
-			pango_scale[1] = PANGO_SCALE_SMALL;
-			pango_scale[2] = PANGO_SCALE_MEDIUM;
-			pango_scale[3] = PANGO_SCALE_LARGE;
-			pango_scale[4] = PANGO_SCALE_X_LARGE;
-			pango_scale[5] = PANGO_SCALE_XX_LARGE;
-			pango_scale[6] = 1.2 * PANGO_SCALE_XX_LARGE;
-			break;
+
+		default_zoom_level = get_default_zoom_level ();
+
+		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 + i] = 1.2 * pango_scale[i];
 		}
 	}
 					 
@@ -704,7 +648,7 @@ fm_list_view_set_zoom_level (FMListView 
 	nautilus_file_set_integer_metadata
 		(fm_directory_view_get_directory_as_file (FM_DIRECTORY_VIEW (view)), 
 		 NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL, 
-		 default_zoom_level_auto_value,
+		 get_default_zoom_level (),
 		 new_level);
 
 	/* Select correctly scaled icons. */
@@ -763,7 +707,7 @@ fm_list_view_restore_default_zoom_level 
 
 	list_view = FM_LIST_VIEW (view);
 
-	fm_list_view_set_zoom_level (list_view, default_zoom_level_auto_value, FALSE);
+	fm_list_view_set_zoom_level (list_view, get_default_zoom_level (), FALSE);
 }
 
 static gboolean 
@@ -819,6 +763,9 @@ click_policy_changed_callback (gpointer 
 			      "underline", PANGO_UNDERLINE_NONE,
 			      NULL);
 	}
+
+	gtk_tree_model_foreach (GTK_TREE_MODEL (view->details->model),
+				list_view_changed_foreach, NULL);
 }
 
 static void


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