[nautilus] Remove text besides icons mode for icon view



commit 6aac88928b1935c8e4f5c54a61935f05c57d740e
Author: William Jon McCann <jmccann redhat com>
Date:   Fri Jun 29 13:40:56 2012 -0400

    Remove text besides icons mode for icon view
    
    This doesn't really work well, it is inconsistent with the file chooser,
    isn't use anywhere else in GNOME, and we want to enhance the list
    view to cover this case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676531

 libnautilus-private/nautilus-global-preferences.h  |    2 -
 libnautilus-private/nautilus-icon-canvas-item.c    |  121 ++++---------------
 libnautilus-private/nautilus-icon-container.c      |  125 ++++----------------
 libnautilus-private/nautilus-icon-container.h      |    1 -
 libnautilus-private/nautilus.convert               |    1 -
 .../org.gnome.nautilus.gschema.xml.in              |    5 -
 src/nautilus-desktop-icon-view.c                   |    1 -
 src/nautilus-file-management-properties.c          |    4 -
 src/nautilus-file-management-properties.ui         |   17 ---
 src/nautilus-icon-view.c                           |   62 ----------
 10 files changed, 49 insertions(+), 290 deletions(-)
---
diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h
index a9099a4..c067035 100644
--- a/libnautilus-private/nautilus-global-preferences.h
+++ b/libnautilus-private/nautilus-global-preferences.h
@@ -94,8 +94,6 @@ enum
 /* Icon View */
 #define NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL		"default-zoom-level"
 
-#define NAUTILUS_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS		"labels-beside-icons"
-
 /* Which text attributes appear beneath icon names */
 #define NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS				"captions"
 
diff --git a/libnautilus-private/nautilus-icon-canvas-item.c b/libnautilus-private/nautilus-icon-canvas-item.c
index 1d440e2..259145d 100644
--- a/libnautilus-private/nautilus-icon-canvas-item.c
+++ b/libnautilus-private/nautilus-icon-canvas-item.c
@@ -52,8 +52,6 @@
 #define LABEL_LINE_SPACING 0
 
 #define MAX_TEXT_WIDTH_STANDARD 135
-#define MAX_TEXT_WIDTH_BESIDE 90
-#define MAX_TEXT_WIDTH_BESIDE_TOP_TO_BOTTOM 150
 
 /* special text height handling
  * each item has three text height variables:
@@ -62,7 +60,6 @@
  *       		      âsane amountâ of text.
  *   âsane amountâ as of
  *      + hard-coded to three lines in text-below-icon mode.
- *      + unlimited in text-besides-icon mode (see VOODOO-TODO)
  *
  *  This layout height is used by grid layout algorithms, even
  *  though the actually displayed and/or requested text size may be larger
@@ -627,54 +624,22 @@ compute_text_rectangle (const NautilusIconCanvasItem *item,
 		text_height_for_entire_text = item->details->text_height_for_entire_text / pixels_per_unit;
 		text_dx = item->details->text_dx / pixels_per_unit;
 	}
-	
-	if (NAUTILUS_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas)->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		if (!nautilus_icon_container_is_layout_rtl (NAUTILUS_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas))) {
-                	text_rectangle.x0 = icon_rectangle.x1;
-                	text_rectangle.x1 = text_rectangle.x0 + text_dx + text_width;
-		} else {
-                	text_rectangle.x1 = icon_rectangle.x0;
-                	text_rectangle.x0 = text_rectangle.x1 - text_dx - text_width;
-		}
 
-		/* VOODOO-TODO */
-#if 0
-		if (for_layout) {
-			/* in this case, we should be more smart and calculate the size according to the maximum
-			 * number of lines fitting next to the icon. However, this requires a more complex layout logic.
-			 * It would mean that when measuring the label, the icon dimensions must be known already,
-			 * and we
-			 *   1. start with an unlimited layout
-			 *   2. measure how many lines of this layout fit next to the icon
-			 *   3. limit the number of lines to the given number of fitting lines
-			 */
-			real_text_height = VOODOO();
-		} else {
-#endif
-			real_text_height = text_height_for_entire_text;
-#if 0
-		}
-#endif
+	text_rectangle.x0 = (icon_rectangle.x0 + icon_rectangle.x1) / 2 - (int) text_width / 2;
+	text_rectangle.y0 = icon_rectangle.y1;
+	text_rectangle.x1 = text_rectangle.x0 + text_width;
 
-                text_rectangle.y0 = (icon_rectangle.y0 + icon_rectangle.y1) / 2- (int) real_text_height / 2;
-                text_rectangle.y1 = text_rectangle.y0 + real_text_height;
+	if (usage == BOUNDS_USAGE_FOR_LAYOUT) {
+		real_text_height = text_height_for_layout;
+	} else if (usage == BOUNDS_USAGE_FOR_ENTIRE_ITEM) {
+		real_text_height = text_height_for_entire_text;
+	} else if (usage == BOUNDS_USAGE_FOR_DISPLAY) {
+		real_text_height = text_height;
 	} else {
-                text_rectangle.x0 = (icon_rectangle.x0 + icon_rectangle.x1) / 2 - (int) text_width / 2;
-                text_rectangle.y0 = icon_rectangle.y1;
-                text_rectangle.x1 = text_rectangle.x0 + text_width;
-
-		if (usage == BOUNDS_USAGE_FOR_LAYOUT) {
-			real_text_height = text_height_for_layout;
-		} else if (usage == BOUNDS_USAGE_FOR_ENTIRE_ITEM) {
-			real_text_height = text_height_for_entire_text;
-		} else if (usage == BOUNDS_USAGE_FOR_DISPLAY) {
-			real_text_height = text_height;
-		} else {
-			g_assert_not_reached ();
-		}
+		g_assert_not_reached ();
+	}
 
-		text_rectangle.y1 = text_rectangle.y0 + real_text_height + LABEL_OFFSET / pixels_per_unit;
-        }
+	text_rectangle.y1 = text_rectangle.y0 + real_text_height + LABEL_OFFSET / pixels_per_unit;
 
 	return text_rectangle;
 }
@@ -802,8 +767,6 @@ layout_get_size_for_layout (PangoLayout *layout,
 	} else {
 		*height_for_layout = 0;
 		iter = pango_layout_get_iter (layout);
-		/* VOODOO-TODO, determine number of lines based on the icon size for text besides icon.
-		 * cf. compute_text_rectangle() */
 		for (i = 0; i < max_layout_line_count; i++) {
 			pango_layout_iter_get_line_extents (iter, NULL, &logical_rect);
 			*height_for_layout += (logical_rect.height + PANGO_SCALE / 2) / PANGO_SCALE;
@@ -818,11 +781,6 @@ layout_get_size_for_layout (PangoLayout *layout,
 	}
 }
 
-#define IS_COMPACT_VIEW(container) \
-        ((container->details->layout_mode == NAUTILUS_ICON_LAYOUT_T_B_L_R || \
-	  container->details->layout_mode == NAUTILUS_ICON_LAYOUT_T_B_R_L) && \
-	 container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE)
-
 #define TEXT_BACK_PADDING_X 4
 #define TEXT_BACK_PADDING_Y 1
 
@@ -848,11 +806,7 @@ prepare_pango_layout_for_measure_entire_text (NautilusIconCanvasItem *item,
 
 	container = NAUTILUS_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas);
 
-	if (IS_COMPACT_VIEW (container)) {
-		pango_layout_set_height (layout, -1);
-	} else {
-		pango_layout_set_height (layout, G_MININT);
-	}
+	pango_layout_set_height (layout, G_MININT);
 }
 
 static void
@@ -870,13 +824,10 @@ prepare_pango_layout_for_draw (NautilusIconCanvasItem *item,
 
 	needs_highlight = details->is_highlighted_for_selection || details->is_highlighted_for_drop;
 
-	if (IS_COMPACT_VIEW (container)) {
-		pango_layout_set_height (layout, -1);
-	} else if (needs_highlight ||
-		   details->is_prelit ||
-		   details->is_highlighted_as_keyboard_focus ||
-		   details->entire_text ||
-		   container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
+	if (needs_highlight ||
+	    details->is_prelit ||
+	    details->is_highlighted_as_keyboard_focus ||
+	    details->entire_text) {
 		/* VOODOO-TODO, cf. compute_text_rectangle() */
 		pango_layout_set_height (layout, G_MININT);
 	} else {
@@ -1027,7 +978,7 @@ draw_label_text (NautilusIconCanvasItem *item,
 	GtkStyleContext *context;
 	GtkStateFlags state, base_state;
 	gboolean have_editable, have_additional;
-	gboolean needs_highlight, prelight_label, is_rtl_label_beside;
+	gboolean needs_highlight, prelight_label;
 	EelIRect text_rect;
 	int x;
 	int max_text_width;
@@ -1052,8 +1003,6 @@ draw_label_text (NautilusIconCanvasItem *item,
 	text_rect = compute_text_rectangle (item, icon_rect, TRUE, BOUNDS_USAGE_FOR_DISPLAY);
 
 	needs_highlight = details->is_highlighted_for_selection || details->is_highlighted_for_drop;
-	is_rtl_label_beside = nautilus_icon_container_is_layout_rtl (container) &&
-			      container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE;
 
 	editable_layout = NULL;
 	additional_layout = NULL;
@@ -1078,9 +1027,9 @@ draw_label_text (NautilusIconCanvasItem *item,
 	    !details->is_renaming) {
 		state |= GTK_STATE_FLAG_SELECTED;
 
-		frame_x = is_rtl_label_beside ? text_rect.x0 + item->details->text_dx : text_rect.x0;
+		frame_x = text_rect.x0;
 		frame_y = text_rect.y0;
-		frame_w = is_rtl_label_beside ? text_rect.x1 - text_rect.x0 - item->details->text_dx : text_rect.x1 - text_rect.x0;
+		frame_w = text_rect.x1 - text_rect.x0;
 		frame_h = text_rect.y1 - text_rect.y0;
 	} else if (!needs_highlight && have_editable &&
 		   details->text_width > 0 && details->text_height > 0 &&
@@ -1109,12 +1058,8 @@ draw_label_text (NautilusIconCanvasItem *item,
 		gtk_style_context_restore (context);
 	}
 
-	if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		x = text_rect.x0 + 2;
-	} else {
-		x = text_rect.x0 + ((text_rect.x1 - text_rect.x0) - max_text_width) / 2;
-	}
-	
+	x = text_rect.x0 + ((text_rect.x1 - text_rect.x0) - max_text_width) / 2;
+
 	if (have_editable &&
 	    !details->is_renaming) {
 		state = base_state;
@@ -1517,16 +1462,7 @@ create_label_layout (NautilusIconCanvasItem *item,
 
 	pango_layout_set_text (layout, zeroified_text, -1);
 	pango_layout_set_auto_dir (layout, FALSE);
-	
-	if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		if (!nautilus_icon_container_is_layout_rtl (container)) {
-			pango_layout_set_alignment (layout, PANGO_ALIGN_LEFT);
-		} else {
-			pango_layout_set_alignment (layout, PANGO_ALIGN_RIGHT);
-		}
-	} else {
-		pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
-	}
+	pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
 
 	pango_layout_set_spacing (layout, LABEL_LINE_SPACING);
 	pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
@@ -2052,16 +1988,7 @@ nautilus_icon_canvas_item_get_max_text_width (NautilusIconCanvasItem *item)
 	canvas_item = EEL_CANVAS_ITEM (item);
 	container = NAUTILUS_ICON_CONTAINER (canvas_item->canvas);
 
-	if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		if (container->details->layout_mode == NAUTILUS_ICON_LAYOUT_T_B_L_R ||
-		    container->details->layout_mode == NAUTILUS_ICON_LAYOUT_T_B_R_L) {
-			return -1;
-		} else {
-			return MAX_TEXT_WIDTH_BESIDE * canvas_item->canvas->pixels_per_unit;
-		}
-	} else {
-		return MAX_TEXT_WIDTH_STANDARD * canvas_item->canvas->pixels_per_unit;
-	}
+	return MAX_TEXT_WIDTH_STANDARD * canvas_item->canvas->pixels_per_unit;
 }
 
 void
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index 90e876a..49e097d 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -98,8 +98,6 @@
 
 #define STANDARD_ICON_GRID_WIDTH 155
 
-#define TEXT_BESIDE_ICON_GRID_WIDTH 205
-
 /* Desktop layout mode defines */
 #define DESKTOP_PAD_HORIZONTAL 	10
 #define DESKTOP_PAD_VERTICAL 	10
@@ -114,9 +112,6 @@
  */
 #define ICON_SIZE_FOR_LARGE_EMBEDDED_TEXT 55
 
-/* From nautilus-icon-canvas-item.c */
-#define MAX_TEXT_WIDTH_BESIDE 90
-
 #define SNAP_HORIZONTAL(func,x) ((func ((double)((x) - DESKTOP_PAD_HORIZONTAL) / SNAP_SIZE_X) * SNAP_SIZE_X) + DESKTOP_PAD_HORIZONTAL)
 #define SNAP_VERTICAL(func, y) ((func ((double)((y) - DESKTOP_PAD_VERTICAL) / SNAP_SIZE_Y) * SNAP_SIZE_Y) + DESKTOP_PAD_VERTICAL)
 
@@ -1151,11 +1146,7 @@ resort (NautilusIconContainer *container)
 static double
 get_grid_width (NautilusIconContainer *container)
 {
-	if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		return TEXT_BESIDE_ICON_GRID_WIDTH;
-	} else {
-		return STANDARD_ICON_GRID_WIDTH;
-	}
+	return STANDARD_ICON_GRID_WIDTH;
 }
 #endif
 typedef struct {
@@ -1190,12 +1181,7 @@ lay_down_one_line (NautilusIconContainer *container,
 		icon = p->data;
 
 		position = &g_array_index (positions, IconPositions, i++);
-		
-		if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-			y_offset = (max_height - position->height) / 2;
-		} else {
-			y_offset = position->y_offset;
-		}
+		y_offset = position->y_offset;
 
 		icon_set_position
 			(icon,
@@ -1281,24 +1267,9 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
 	canvas_width = CANVAS_WIDTH(container, allocation);
 	max_icon_width = max_text_width = 0.0;
 
-	if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		/* Would it be worth caching these bounds for the next loop? */
-		for (p = icons; p != NULL; p = p->next) {
-			icon = p->data;
-
-			icon_bounds = nautilus_icon_canvas_item_get_icon_rectangle (icon->item);
-			max_icon_width = MAX (max_icon_width, ceil (icon_bounds.x1 - icon_bounds.x0));
-
-			text_bounds = nautilus_icon_canvas_item_get_text_rectangle (icon->item, TRUE);
-			max_text_width = MAX (max_text_width, ceil (text_bounds.x1 - text_bounds.x0));
-		}
+	grid_width = STANDARD_ICON_GRID_WIDTH;
 
-		grid_width = max_icon_width + max_text_width + ICON_PAD_LEFT + ICON_PAD_RIGHT;
-	} else {
-		grid_width = STANDARD_ICON_GRID_WIDTH;
-	}
-	
-	line_width = container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE ? ICON_PAD_LEFT : 0;
+	line_width = 0;
 	line_start = icons;
 	y = start_y + CONTAINER_PAD_TOP;
 	i = 0;
@@ -1322,23 +1293,15 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
 
 		/* If this icon doesn't fit, it's time to lay out the line that's queued up. */
 		if (line_start != p && line_width + icon_width >= canvas_width ) {
-			if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-				y += ICON_PAD_TOP;
-			} else {
-				/* Advance to the baseline. */
-				y += ICON_PAD_TOP + max_height_above;
-			}
+			/* Advance to the baseline. */
+			y += ICON_PAD_TOP + max_height_above;
 
 			lay_down_one_line (container, line_start, p, y, max_height_above, positions, FALSE);
-			
-			if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-				y += max_height_above + max_height_below + ICON_PAD_BOTTOM;
-			} else {
-				/* Advance to next line. */
-				y += max_height_below + ICON_PAD_BOTTOM;
-			}
-			
-			line_width = container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE ? ICON_PAD_LEFT : 0;
+
+			/* Advance to next line. */
+			y += max_height_below + ICON_PAD_BOTTOM;
+
+			line_width = 0;
 			line_start = p;
 			i = 0;
 			
@@ -1358,13 +1321,8 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
 		position->width = icon_width;
 		position->height = icon_bounds.y1 - icon_bounds.y0;
 
-		if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-			position->x_offset = max_icon_width + ICON_PAD_LEFT + ICON_PAD_RIGHT - (icon_bounds.x1 - icon_bounds.x0);
-			position->y_offset = 0;
-		} else {
-			position->x_offset = (icon_width - (icon_bounds.x1 - icon_bounds.x0)) / 2;
-			position->y_offset = icon_bounds.y0 - icon_bounds.y1;
-		}
+		position->x_offset = (icon_width - (icon_bounds.x1 - icon_bounds.x0)) / 2;
+		position->y_offset = icon_bounds.y0 - icon_bounds.y1;
 
 		/* Add this icon. */
 		line_width += icon_width;
@@ -1372,13 +1330,9 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
 
 	/* Lay down that last line of icons. */
 	if (line_start != NULL) {
-			if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-				y += ICON_PAD_TOP;
-			} else {
-				/* Advance to the baseline. */
-				y += ICON_PAD_TOP + max_height_above;
-			}
-		
+		/* Advance to the baseline. */
+		y += ICON_PAD_TOP + max_height_above;
+
 		lay_down_one_line (container, line_start, NULL, y, max_height_above, positions, TRUE);
 	}
 
@@ -1423,7 +1377,6 @@ get_max_icon_dimensions (GList *icon_start,
 	}
 }
 
-/* column-wise layout. At the moment, this only works with label-beside-icon (used by "Compact View"). */
 static void
 lay_down_icons_vertical (NautilusIconContainer *container,
 			 GList *icons,
@@ -1454,7 +1407,6 @@ lay_down_icons_vertical (NautilusIconContainer *container,
 	int i;
 
 	g_assert (NAUTILUS_IS_ICON_CONTAINER (container));
-	g_assert (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE);
 
 	if (icons == NULL) {
 		return;
@@ -2785,26 +2737,14 @@ static int
 get_cmp_point_x (NautilusIconContainer *container,
 		 EelDRect icon_rect)
 {
-	if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		if (gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL) {
-			return icon_rect.x0;
-		} else {
-			return icon_rect.x1;
-		}
-	} else {
-		return (icon_rect.x0 + icon_rect.x1) / 2;
-	}
+	return (icon_rect.x0 + icon_rect.x1) / 2;
 }
 
 static int
 get_cmp_point_y (NautilusIconContainer *container,
 		 EelDRect icon_rect)
 {
-	if (container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		return (icon_rect.y0 + icon_rect.y1)/2;
-	} else {
-		return icon_rect.y1;
-	}
+	return icon_rect.y1;
 }
 
 
@@ -8135,9 +8075,7 @@ nautilus_icon_container_start_renaming_selected_item (NautilusIconContainer *con
 		eel_editable_label_set_line_wrap_mode (EEL_EDITABLE_LABEL (details->rename_widget), PANGO_WRAP_WORD_CHAR);
 		eel_editable_label_set_draw_outline (EEL_EDITABLE_LABEL (details->rename_widget), TRUE);
 
-		if (details->label_position != NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-			eel_editable_label_set_justify (EEL_EDITABLE_LABEL (details->rename_widget), GTK_JUSTIFY_CENTER);
-		}
+		eel_editable_label_set_justify (EEL_EDITABLE_LABEL (details->rename_widget), GTK_JUSTIFY_CENTER);
 
 		gtk_misc_set_padding (GTK_MISC (details->rename_widget), 1, 1);
 		gtk_layout_put (GTK_LAYOUT (container),
@@ -8161,26 +8099,13 @@ nautilus_icon_container_start_renaming_selected_item (NautilusIconContainer *con
 	icon_rect = nautilus_icon_canvas_item_get_icon_rectangle (icon->item);
 	text_rect = nautilus_icon_canvas_item_get_text_rectangle (icon->item, TRUE);
 
-	if (nautilus_icon_container_is_layout_vertical (container) &&
-	    container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		/* for one-line editables, the width changes dynamically */
-		width = -1;
-	} else {
-		width = nautilus_icon_canvas_item_get_max_text_width (icon->item);
-	}
+	width = nautilus_icon_canvas_item_get_max_text_width (icon->item);
 
-	if (details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
-		eel_canvas_w2c (EEL_CANVAS_ITEM (icon->item)->canvas,
-				text_rect.x0,
-				text_rect.y0,
-				&x, &y);
-	} else {
-		eel_canvas_w2c (EEL_CANVAS_ITEM (icon->item)->canvas,
-				(icon_rect.x0 + icon_rect.x1) / 2,
-				icon_rect.y1,
-				&x, &y);
-		x = x - width / 2 - 1;
-	}
+	eel_canvas_w2c (EEL_CANVAS_ITEM (icon->item)->canvas,
+			(icon_rect.x0 + icon_rect.x1) / 2,
+			icon_rect.y1,
+			&x, &y);
+	x = x - width / 2 - 1;
 
 	gtk_layout_move (GTK_LAYOUT (container),
 			 details->rename_widget,
diff --git a/libnautilus-private/nautilus-icon-container.h b/libnautilus-private/nautilus-icon-container.h
index f87ba15..7841ac4 100644
--- a/libnautilus-private/nautilus-icon-container.h
+++ b/libnautilus-private/nautilus-icon-container.h
@@ -65,7 +65,6 @@ typedef enum {
 
 typedef enum {
 	NAUTILUS_ICON_LABEL_POSITION_UNDER,
-	NAUTILUS_ICON_LABEL_POSITION_BESIDE
 } NautilusIconLabelPosition;
 
 #define	NAUTILUS_ICON_CONTAINER_TYPESELECT_FLUSH_DELAY 1000000
diff --git a/libnautilus-private/nautilus.convert b/libnautilus-private/nautilus.convert
index 5246551..182694e 100644
--- a/libnautilus-private/nautilus.convert
+++ b/libnautilus-private/nautilus.convert
@@ -23,7 +23,6 @@ show-hidden-files = /desktop/gnome/file_views/show_hidden_files
 
 [org.gnome.nautilus.icon-view]
 captions = /apps/nautilus/icon_view/captions
-labels-beside-icons = /apps/nautilus/icon_view/labels_beside_icons
 default-zoom-level = /apps/nautilus/icon_view/default_zoom_level
 thumbnail-size = /apps/nautilus/icon_view/thumbnail_size
 text-ellipsis-limit = /apps/nautilus/icon_view/text_ellipsis_limit
diff --git a/libnautilus-private/org.gnome.nautilus.gschema.xml.in b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
index 8c6eae5..0dac1d5 100644
--- a/libnautilus-private/org.gnome.nautilus.gschema.xml.in
+++ b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
@@ -192,11 +192,6 @@
       "size", "type", "date_modified", "date_changed", "date_accessed", "owner",
       "group", "permissions", "octal_permissions" and "mime_type".</_description>
     </key>
-    <key name="labels-beside-icons" type="b">
-      <default>false</default>
-      <_summary>Put labels beside icons</_summary>
-      <_description>If true, labels will be placed beside icons rather than underneath them.</_description>
-    </key>
     <key name="default-zoom-level" enum="org.gnome.nautilus.ZoomLevel">
       <default>'standard'</default>
       <_summary>Default icon zoom level</_summary>
diff --git a/src/nautilus-desktop-icon-view.c b/src/nautilus-desktop-icon-view.c
index 6e5aac9..f9b9d52 100644
--- a/src/nautilus-desktop-icon-view.c
+++ b/src/nautilus-desktop-icon-view.c
@@ -764,7 +764,6 @@ nautilus_desktop_icon_view_create (NautilusWindowSlot *slot)
 			     "supports-auto-layout", FALSE,
 			     "supports-scaling", TRUE,
 			     "supports-keep-aligned", TRUE,
-			     "supports-labels-beside-icons", FALSE,
 			     NULL);
 	return NAUTILUS_VIEW (view);
 }
diff --git a/src/nautilus-file-management-properties.c b/src/nautilus-file-management-properties.c
index e212912..77564eb 100644
--- a/src/nautilus-file-management-properties.c
+++ b/src/nautilus-file-management-properties.c
@@ -51,7 +51,6 @@
 
 /* bool preferences */
 #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_FOLDERS_FIRST_WIDGET "sort_folders_first_checkbutton"
-#define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_LABELS_BESIDE_ICONS_WIDGET "labels_beside_icons_checkbutton"
 #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_ALWAYS_USE_BROWSER_WIDGET "always_use_browser_checkbutton"
 #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_CONFIRM_WIDGET "trash_confirm_checkbutton"
 #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_DELETE_WIDGET "trash_delete_checkbutton"
@@ -688,9 +687,6 @@ nautilus_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow
 							       4);
 
 	/* setup preferences */
-	bind_builder_bool (builder, nautilus_icon_view_preferences,
-			   NAUTILUS_FILE_MANAGEMENT_PROPERTIES_LABELS_BESIDE_ICONS_WIDGET,
-			   NAUTILUS_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS);
 	bind_builder_bool (builder, nautilus_preferences,
 			   NAUTILUS_FILE_MANAGEMENT_PROPERTIES_FOLDERS_FIRST_WIDGET,
 			   NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
diff --git a/src/nautilus-file-management-properties.ui b/src/nautilus-file-management-properties.ui
index 3a0335e..09605c3 100644
--- a/src/nautilus-file-management-properties.ui
+++ b/src/nautilus-file-management-properties.ui
@@ -319,23 +319,6 @@
                                 <property name="position">0</property>
                               </packing>
                             </child>
-                            <child>
-                              <object class="GtkCheckButton" id="labels_beside_icons_checkbutton">
-                                <property name="label" translatable="yes">_Text beside icons</property>
-                                <property name="use_action_appearance">False</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
-                                <property name="use_underline">True</property>
-                                <property name="draw_indicator">True</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
                           </object>
                         </child>
                       </object>
diff --git a/src/nautilus-icon-view.c b/src/nautilus-icon-view.c
index 17a40a2..99cfa63 100644
--- a/src/nautilus-icon-view.c
+++ b/src/nautilus-icon-view.c
@@ -71,7 +71,6 @@ enum
 	PROP_SUPPORTS_AUTO_LAYOUT = 1,
 	PROP_SUPPORTS_SCALING,
 	PROP_SUPPORTS_KEEP_ALIGNED,
-	PROP_SUPPORTS_LABELS_BESIDE_ICONS,
 	NUM_PROPERTIES
 };
 
@@ -114,7 +113,6 @@ struct NautilusIconViewDetails
 	gboolean supports_auto_layout;
 	gboolean supports_scaling;
 	gboolean supports_keep_aligned;
-	gboolean supports_labels_beside_icons;
 };
 
 
@@ -578,14 +576,6 @@ nautilus_icon_view_supports_keep_aligned (NautilusIconView *view)
 	return view->details->supports_keep_aligned;
 }
 
-static gboolean
-nautilus_icon_view_supports_labels_beside_icons (NautilusIconView *view)
-{
-	g_return_val_if_fail (NAUTILUS_IS_ICON_VIEW (view), FALSE);
-
-	return view->details->supports_labels_beside_icons;
-}
-
 static void
 update_layout_menus (NautilusIconView *view)
 {
@@ -878,27 +868,6 @@ get_default_zoom_level (NautilusIconView *icon_view)
 }
 
 static void
-set_labels_beside_icons (NautilusIconView *icon_view)
-{
-	gboolean labels_beside;
-
-	if (nautilus_icon_view_supports_labels_beside_icons (icon_view)) {
-		labels_beside =  g_settings_get_boolean (nautilus_icon_view_preferences,
-							 NAUTILUS_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS);
-
-		if (labels_beside) {
-			nautilus_icon_container_set_label_position
-				(get_icon_container (icon_view),
-				 NAUTILUS_ICON_LABEL_POSITION_BESIDE);
-		} else {
-			nautilus_icon_container_set_label_position
-				(get_icon_container (icon_view),
-				 NAUTILUS_ICON_LABEL_POSITION_UNDER);
-		}
-	}
-}
-
-static void
 nautilus_icon_view_begin_loading (NautilusView *view)
 {
 	NautilusIconView *icon_view;
@@ -944,8 +913,6 @@ nautilus_icon_view_begin_loading (NautilusView *view)
 		(get_icon_container (icon_view), 
 		 nautilus_icon_view_get_directory_keep_aligned (icon_view, file));
 
-	set_labels_beside_icons (icon_view);
-
 	/* We must set auto-layout last, because it invokes the layout_changed 
 	 * callback, which works incorrectly if the other layout criteria are
 	 * not already set up properly (see bug 6500, e.g.)
@@ -1976,18 +1943,6 @@ default_zoom_level_changed_callback (gpointer callback_data)
 }
 
 static void
-labels_beside_icons_changed_callback (gpointer callback_data)
-{
-	NautilusIconView *icon_view;
-
-	g_return_if_fail (NAUTILUS_IS_ICON_VIEW (callback_data));
-
-	icon_view = NAUTILUS_ICON_VIEW (callback_data);
-
-	set_labels_beside_icons (icon_view);
-}
-
-static void
 nautilus_icon_view_sort_directories_first_changed (NautilusView *directory_view)
 {
 	NautilusIconView *icon_view;
@@ -2290,9 +2245,6 @@ nautilus_icon_view_set_property (GObject         *object,
 	case PROP_SUPPORTS_KEEP_ALIGNED:
 		icon_view->details->supports_keep_aligned = g_value_get_boolean (value);
 		break;
-	case PROP_SUPPORTS_LABELS_BESIDE_ICONS:
-		icon_view->details->supports_labels_beside_icons = g_value_get_boolean (value);
-		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
@@ -2322,9 +2274,6 @@ nautilus_icon_view_finalize (GObject *object)
 					      default_zoom_level_changed_callback,
 					      icon_view);
 	g_signal_handlers_disconnect_by_func (nautilus_icon_view_preferences,
-					      labels_beside_icons_changed_callback,
-					      icon_view);
-	g_signal_handlers_disconnect_by_func (nautilus_icon_view_preferences,
 					      text_attribute_names_changed_callback,
 					      icon_view);
 
@@ -2403,13 +2352,6 @@ nautilus_icon_view_class_init (NautilusIconViewClass *klass)
 				      FALSE,
 				      G_PARAM_WRITABLE |
 				      G_PARAM_CONSTRUCT_ONLY);
-	properties[PROP_SUPPORTS_LABELS_BESIDE_ICONS] =
-		g_param_spec_boolean ("supports-labels-beside-icons",
-				      "Supports labels beside icons",
-				      "Whether this view supports labels beside icons",
-				      TRUE,
-				      G_PARAM_WRITABLE |
-				      G_PARAM_CONSTRUCT_ONLY);
 
 	g_object_class_install_properties (oclass, NUM_PROPERTIES, properties);
 }
@@ -2451,10 +2393,6 @@ nautilus_icon_view_init (NautilusIconView *icon_view)
 				  G_CALLBACK (default_zoom_level_changed_callback),
 				  icon_view);
 	g_signal_connect_swapped (nautilus_icon_view_preferences,
-				  "changed::" NAUTILUS_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS,
-				  G_CALLBACK (labels_beside_icons_changed_callback),
-				  icon_view);
-	g_signal_connect_swapped (nautilus_icon_view_preferences,
 				  "changed::" NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS,
 				  G_CALLBACK (text_attribute_names_changed_callback),
 				  icon_view);



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