nautilus r14490 - in trunk: . libnautilus-private
- From: cneumair svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r14490 - in trunk: . libnautilus-private
- Date: Mon, 18 Aug 2008 23:06:37 +0000 (UTC)
Author: cneumair
Date: Mon Aug 18 23:06:36 2008
New Revision: 14490
URL: http://svn.gnome.org/viewvc/nautilus?rev=14490&view=rev
Log:
2008-08-19 Christian Neumair <cneumair gnome org>
* libnautilus-private/nautilus-icon-canvas-item.c
(draw_or_measure_label_text),
(nautilus_icon_canvas_item_set_entire_text):
* libnautilus-private/nautilus-icon-canvas-item.h:
* libnautilus-private/nautilus-icon-container.c
(lay_down_one_line), (lay_down_icons_horizontal):
Never ellipsise text in last line of a line-wise layout.
Modified:
trunk/ChangeLog
trunk/libnautilus-private/nautilus-icon-canvas-item.c
trunk/libnautilus-private/nautilus-icon-canvas-item.h
trunk/libnautilus-private/nautilus-icon-container.c
Modified: trunk/libnautilus-private/nautilus-icon-canvas-item.c
==============================================================================
--- trunk/libnautilus-private/nautilus-icon-canvas-item.c (original)
+++ trunk/libnautilus-private/nautilus-icon-canvas-item.c Mon Aug 18 23:06:36 2008
@@ -91,6 +91,11 @@
* icons, if an icon is selected.
*/
int text_height_for_layout;
+
+ /* whether the entire text must always be visible. In that case,
+ * text_height_for_layout will always be equal to text_height.
+ * Used for the last line of a line-wise icon layout. */
+ guint entire_text : 1;
/* preview state */
guint is_active : 1;
@@ -1013,6 +1018,7 @@
#define IS_COMPACT_VIEW(container) \
container->details->layout_mode == NAUTILUS_ICON_LAYOUT_T_B_L_R && \
container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE
+#include "nautilus-file.h"
static void
draw_or_measure_label_text (NautilusIconCanvasItem *item,
@@ -1102,6 +1108,7 @@
pango_layout_set_height (editable_layout, -1);
} else if (needs_highlight ||
details->is_prelit ||
+ details->entire_text ||
container->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
/* VOODOO-TODO, cf. compute_text_rectangle() */
pango_layout_set_height (editable_layout, G_MININT);
@@ -3364,6 +3371,19 @@
iface->get_text = nautilus_icon_canvas_item_get_text;
}
+void
+nautilus_icon_canvas_item_set_entire_text (NautilusIconCanvasItem *item,
+ gboolean entire_text)
+{
+ if (item->details->entire_text != entire_text) {
+ item->details->entire_text = entire_text;
+
+ nautilus_icon_canvas_item_invalidate_label_size (item);
+ eel_canvas_item_request_update (EEL_CANVAS_ITEM (item));
+ }
+}
+
+
/* Class initialization function for the icon canvas item. */
static void
nautilus_icon_canvas_item_class_init (NautilusIconCanvasItemClass *class)
Modified: trunk/libnautilus-private/nautilus-icon-canvas-item.h
==============================================================================
--- trunk/libnautilus-private/nautilus-icon-canvas-item.h (original)
+++ trunk/libnautilus-private/nautilus-icon-canvas-item.h Mon Aug 18 23:06:36 2008
@@ -96,6 +96,9 @@
double i2w_dx, double i2w_dy);
void nautilus_icon_canvas_item_set_is_visible (NautilusIconCanvasItem *item,
gboolean visible);
+/* whether the entire label text must be visible at all times */
+void nautilus_icon_canvas_item_set_entire_text (NautilusIconCanvasItem *icon_item,
+ gboolean entire_text);
G_END_DECLS
Modified: trunk/libnautilus-private/nautilus-icon-container.c
==============================================================================
--- trunk/libnautilus-private/nautilus-icon-container.c (original)
+++ trunk/libnautilus-private/nautilus-icon-container.c Mon Aug 18 23:06:36 2008
@@ -1011,7 +1011,8 @@
GList *line_end,
double y,
double max_height,
- GArray *positions)
+ GArray *positions,
+ gboolean whole_text)
{
GList *p;
NautilusIcon *icon;
@@ -1040,6 +1041,7 @@
(icon,
is_rtl ? get_mirror_x_position (container, icon, x + position->x_offset) : x + position->x_offset,
y + y_offset);
+ nautilus_icon_canvas_item_set_entire_text (icon->item, whole_text);
icon->saved_ltr_x = is_rtl ? get_mirror_x_position (container, icon, icon->x) : icon->x;
@@ -1175,7 +1177,7 @@
y += ICON_PAD_TOP + max_height_above;
}
- lay_down_one_line (container, line_start, p, y, max_height_above, positions);
+ 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;
@@ -1229,7 +1231,7 @@
y += ICON_PAD_TOP + max_height_above;
}
- lay_down_one_line (container, line_start, NULL, y, max_height_above, positions);
+ lay_down_one_line (container, line_start, NULL, y, max_height_above, positions, TRUE);
/* Advance to next line. */
y += max_height_below + ICON_PAD_BOTTOM;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]