[gtk+] iconview: Include column spacing in calculation



commit 7c1b5611940d7540e7b7ebd4cc63b0eee88dac46
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jun 13 04:56:22 2012 +0200

    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

 gtk/gtkiconview.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index df40fb6..cdce24c 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]