Commit 48311728 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson
Browse files

measure text in nautilus_icon_canvas_item_get_text_rectangle to avoid

2006-03-03  Alexander Larsson  <alexl@redhat.com>

	* libnautilus-private/nautilus-icon-canvas-item.[ch]:
	measure text in nautilus_icon_canvas_item_get_text_rectangle to avoid
	icons jumping around

	* libnautilus-private/nautilus-icon-container.c:
	remove old workaround

	Patch from Christian Neumair
parent c4bf23d8
2006-03-03 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-icon-canvas-item.[ch]:
measure text in nautilus_icon_canvas_item_get_text_rectangle to avoid
icons jumping around
* libnautilus-private/nautilus-icon-container.c:
remove old workaround
Patch from Christian Neumair
2006-03-02 Stanislav Brabec <sbrabec@suse.cz>
* configure.in: Add "km" to ALL_LINGUAS.
......
......@@ -2043,7 +2043,7 @@ nautilus_icon_canvas_item_get_icon_rectangle (const NautilusIconCanvasItem *item
}
ArtDRect
nautilus_icon_canvas_item_get_text_rectangle (const NautilusIconCanvasItem *item)
nautilus_icon_canvas_item_get_text_rectangle (NautilusIconCanvasItem *item)
{
/* FIXME */
ArtIRect icon_rectangle;
......@@ -2063,6 +2063,7 @@ nautilus_icon_canvas_item_get_text_rectangle (const NautilusIconCanvasItem *item
icon_rectangle.x1 = icon_rectangle.x0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_width (pixbuf)) / pixels_per_unit;
icon_rectangle.y1 = icon_rectangle.y0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_height (pixbuf)) / pixels_per_unit;
measure_label_text (item);
text_rectangle = compute_text_rectangle (item, icon_rectangle, FALSE);
ret.x0 = text_rectangle.x0;
......
......@@ -88,7 +88,7 @@ gboolean nautilus_icon_canvas_item_hit_test_stretch_handles (NautilusIconCanv
GtkCornerType *corner);
void nautilus_icon_canvas_item_invalidate_label_size (NautilusIconCanvasItem *item);
ArtDRect nautilus_icon_canvas_item_get_icon_rectangle (const NautilusIconCanvasItem *item);
ArtDRect nautilus_icon_canvas_item_get_text_rectangle (const NautilusIconCanvasItem *item);
ArtDRect nautilus_icon_canvas_item_get_text_rectangle (NautilusIconCanvasItem *item);
void nautilus_icon_canvas_item_update_bounds (NautilusIconCanvasItem *item,
double i2w_dx, double i2w_dy);
......
......@@ -1015,9 +1015,7 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
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);
max_text_width = MAX (max_text_width, ceil (text_bounds.x1 - text_bounds.x0 < 0
? MAX_TEXT_WIDTH_BESIDE
: text_bounds.x1 - text_bounds.x0));
max_text_width = MAX (max_text_width, ceil (text_bounds.x1 - text_bounds.x0));
}
grid_width = max_icon_width + max_text_width + ICON_PAD_LEFT + ICON_PAD_RIGHT;
......
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