Commit 4d712979 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

For column layout, do not limit text width if each columns determines its

2008-03-31  Christian Neumair  <cneumair@gnome.org>

	* libnautilus-private/nautilus-icon-canvas-item.c
	(create_label_layout),
	(nautilus_icon_canvas_item_get_max_text_width):
	* libnautilus-private/nautilus-icon-container.c
	(nautilus_icon_container_start_renaming_selected_item):
	For column layout, do not limit text width if each columns determines
	its own width.

svn path=/trunk/; revision=14009
parent ccbc2896
2008-03-31 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-icon-canvas-item.c
(create_label_layout),
(nautilus_icon_canvas_item_get_max_text_width):
* libnautilus-private/nautilus-icon-container.c
(nautilus_icon_container_start_renaming_selected_item):
For column layout, do not limit text width if each columns determines
its own width.
2008-03-30 Christian Neumair <cneumair@gnome.org>
* src/file-manager/fm-icon-view.c
......
......@@ -1862,7 +1862,11 @@ create_label_layout (NautilusIconCanvasItem *item,
}
pango_layout_set_text (layout, zeroified_text, -1);
pango_layout_set_width (layout, floor (nautilus_icon_canvas_item_get_max_text_width (item)) * PANGO_SCALE);
if (nautilus_icon_canvas_item_get_max_text_width (item) < 0) {
pango_layout_set_width (layout, -1);
} else {
pango_layout_set_width (layout, floor (nautilus_icon_canvas_item_get_max_text_width (item)) * PANGO_SCALE);
}
pango_layout_set_auto_dir (layout, FALSE);
......@@ -2433,16 +2437,23 @@ double
nautilus_icon_canvas_item_get_max_text_width (NautilusIconCanvasItem *item)
{
EelCanvasItem *canvas_item;
NautilusIconContainer *container;
canvas_item = EEL_CANVAS_ITEM (item);
if (nautilus_icon_container_is_tighter_layout (NAUTILUS_ICON_CONTAINER (canvas_item->canvas))) {
container = NAUTILUS_ICON_CONTAINER (canvas_item->canvas);
if (nautilus_icon_container_is_tighter_layout (container)) {
return MAX_TEXT_WIDTH_TIGHTER * canvas_item->canvas->pixels_per_unit;
} else {
if (NAUTILUS_ICON_CONTAINER (canvas_item->canvas)->details->label_position == NAUTILUS_ICON_LABEL_POSITION_BESIDE) {
if (NAUTILUS_ICON_CONTAINER (canvas_item->canvas)->details->layout_mode == NAUTILUS_ICON_LAYOUT_T_B_L_R ||
NAUTILUS_ICON_CONTAINER (canvas_item->canvas)->details->layout_mode == NAUTILUS_ICON_LAYOUT_T_B_R_L) {
return MAX_TEXT_WIDTH_BESIDE_TOP_TO_BOTTOM * canvas_item->canvas->pixels_per_unit;
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) {
if (container->details->all_columns_same_width) {
return MAX_TEXT_WIDTH_BESIDE_TOP_TO_BOTTOM * canvas_item->canvas->pixels_per_unit;
} else {
return -1;
}
} else {
return MAX_TEXT_WIDTH_BESIDE * canvas_item->canvas->pixels_per_unit;
}
......
......@@ -7253,9 +7253,15 @@ 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);
width = nautilus_icon_canvas_item_get_max_text_width (icon->item);
if ((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) {
/* for one-line editables, the width changes dynamically */
width = -1;
} else {
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,
......
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