iconview: Include column spacing in calculation

The function is probably almost never used, so nobody has ever seen this
bug, but we should still get it right.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
This commit is contained in:
Benjamin Otte 2012-06-13 04:56:22 +02:00
parent 4b83be0e26
commit 7c1b561194

View File

@ -1668,8 +1668,8 @@ gtk_icon_view_get_preferred_width_for_height (GtkWidget *widget,
n_items = gtk_icon_view_get_n_items (icon_view);
gtk_icon_view_get_preferred_item_size (icon_view, GTK_ORIENTATION_HORIZONTAL, row_height, &item_min, &item_nat);
*minimum = item_min * ((n_items + rows - 1) / rows);
*natural = item_nat * ((n_items + rows - 1) / rows);
*minimum = (item_min + priv->column_spacing) * ((n_items + rows - 1) / rows) - priv->column_spacing;
*natural = (item_nat + priv->column_spacing) * ((n_items + rows - 1) / rows) - priv->column_spacing;
*minimum += 2 * priv->margin;
*natural += 2 * priv->margin;