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



commit 62292dc24764042487bba283bb811a27e8f48f9e
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 63f67a5..e918271 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]