Commit 715543d7 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

Never ellipsise text in last line of a line-wise layout.

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.

svn path=/trunk/; revision=14490
parent 9286eee0
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.
2008-08-18 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/apps_nautilus_preferences.schemas.in:
......
......@@ -91,6 +91,11 @@ struct NautilusIconCanvasItemDetails {
* 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 @@ layout_get_full_size (PangoLayout *layout,
#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 @@ draw_or_measure_label_text (NautilusIconCanvasItem *item,
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 @@ nautilus_icon_canvas_item_text_interface_init (EelAccessibleTextIface *iface)
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)
......
......@@ -96,6 +96,9 @@ void nautilus_icon_canvas_item_update_bounds (NautilusIconCanv
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
......
......@@ -1011,7 +1011,8 @@ lay_down_one_line (NautilusIconContainer *container,
GList *line_end,
double y,
double max_height,
GArray *positions)
GArray *positions,
gboolean whole_text)
{
GList *p;
NautilusIcon *icon;
......@@ -1040,6 +1041,7 @@ lay_down_one_line (NautilusIconContainer *container,
(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 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
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 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment