[gtk+/gtk-3-4] iconview: Don't add item-padding



commit a3018f97c87f22013c63404aada6c2bcd3013127
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jun 14 07:35:15 2012 +0200

    iconview: Don't add item-padding
    
    ... to item sizes when there are no items.

 gtk/gtkiconview.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index df40fb6..f5ddf2b 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1467,6 +1467,13 @@ gtk_icon_view_get_preferred_item_size (GtkIconView    *icon_view,
   GtkCellAreaContext *context;
   GList *items;
 
+  if (priv->items == NULL)
+    {
+      *minimum = 0;
+      *natural = 0;
+      return;
+    }
+
   context = gtk_cell_area_create_context (priv->cell_area);
 
   for_size -= 2 * priv->item_padding;



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