Apply some arbitrary lower limit for the guessed wrap width. (#332466,

2006-03-05  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkiconview.c (adjust_wrap_width): Apply some
	arbitrary lower limit for the guessed wrap width. (#332466,
	Donald Straney)
This commit is contained in:
Matthias Clasen 2006-03-06 04:55:53 +00:00 committed by Matthias Clasen
parent 459eeebde9
commit 6c5c31f75b
3 changed files with 70 additions and 40 deletions

View File

@ -1,3 +1,18 @@
2006-03-05 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkiconview.c (adjust_wrap_width): Apply some
arbitrary lower limit for the guessed wrap width. (#332466,
Donald Straney)
2006-03-05 Matthias Clasen <mclasen@redhat.com>
Fix handling of image-only buttons. (#332985, Kalle
Vahlmann, #333555)
* gtk/gtkbutton.c (gtk_button_construct_child): Don't
return early if there an image to show.
(show_image): Always return TRUE if there is no text.
2006-03-04 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkinput-x11 (gdk_input_translate_coordinates):

View File

@ -1,3 +1,18 @@
2006-03-05 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkiconview.c (adjust_wrap_width): Apply some
arbitrary lower limit for the guessed wrap width. (#332466,
Donald Straney)
2006-03-05 Matthias Clasen <mclasen@redhat.com>
Fix handling of image-only buttons. (#332985, Kalle
Vahlmann, #333555)
* gtk/gtkbutton.c (gtk_button_construct_child): Don't
return early if there an image to show.
(show_image): Always return TRUE if there is no text.
2006-03-04 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkinput-x11 (gdk_input_translate_coordinates):

View File

@ -2607,7 +2607,7 @@ adjust_wrap_width (GtkIconView *icon_view,
NULL);
if (item->width == -1)
wrap_width = pixbuf_width;
wrap_width = MAX (2 * pixbuf_width, 50);
else if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
wrap_width = item->width;
else
@ -2657,7 +2657,7 @@ gtk_icon_view_calculate_item_size (GtkIconView *icon_view,
NULL, NULL, NULL,
&item->box[info->position].width,
&item->box[info->position].height);
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
item->width += item->box[info->position].width
@ -2710,45 +2710,45 @@ gtk_icon_view_calculate_item_size2 (GtkIconView *icon_view,
continue;
if (!info->cell->visible)
continue;
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
cell_area.width = item->box[info->position].width;
cell_area.height = item->height;
}
else
{
cell_area.width = item->width;
cell_area.height = max_height[i];
}
gtk_cell_renderer_get_size (info->cell, GTK_WIDGET (icon_view),
&cell_area,
&item->box[info->position].x, &item->box[info->position].y,
&item->box[info->position].width, &item->box[info->position].height);
item->box[info->position].x += cell_area.x;
item->box[info->position].y += cell_area.y;
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
item->before[info->position] = item->box[info->position].x - cell_area.x;
item->after[info->position] = cell_area.width - item->box[info->position].width - item->before[info->position];
cell_area.x += cell_area.width + spacing;
}
else
{
if (item->box[info->position].width > item->width)
{
item->width = item->box[info->position].width;
cell_area.width = item->width;
}
item->before[info->position] = item->box[info->position].y - cell_area.y;
item->after[info->position] = cell_area.height - item->box[info->position].height - item->before[info->position];
cell_area.y += cell_area.height + spacing;
}
}
continue;
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
cell_area.width = item->box[info->position].width;
cell_area.height = item->height;
}
else
{
cell_area.width = item->width;
cell_area.height = max_height[i];
}
gtk_cell_renderer_get_size (info->cell, GTK_WIDGET (icon_view),
&cell_area,
&item->box[info->position].x, &item->box[info->position].y,
&item->box[info->position].width, &item->box[info->position].height);
item->box[info->position].x += cell_area.x;
item->box[info->position].y += cell_area.y;
if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
item->before[info->position] = item->box[info->position].x - cell_area.x;
item->after[info->position] = cell_area.width - item->box[info->position].width - item->before[info->position];
cell_area.x += cell_area.width + spacing;
}
else
{
if (item->box[info->position].width > item->width)
{
item->width = item->box[info->position].width;
cell_area.width = item->width;
}
item->before[info->position] = item->box[info->position].y - cell_area.y;
item->after[info->position] = cell_area.height - item->box[info->position].height - item->before[info->position];
cell_area.y += cell_area.height + spacing;
}
}
if (rtl && icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
for (i = 0; i < icon_view->priv->n_cells; i++)