[gtk+/gtk-3-4] iconview: Add a descriptive function



commit d5685b391e477bc1ad8d109c8338367926372873
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jun 14 18:52:09 2012 +0200

    iconview: Add a descriptive function
    
    I want to special-case empty icon views in the sizing code to avoid
    various bugs, and having such a function is nice.

 gtk/gtkiconview.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index cd580f3..848ccab 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1456,6 +1456,12 @@ cell_area_get_preferred_size (GtkIconView        *icon_view,
     }
 }
 
+static gboolean
+gtk_icon_view_is_empty (GtkIconView *icon_view)
+{
+  return icon_view->priv->items == NULL;
+}
+
 static void
 gtk_icon_view_get_preferred_item_size (GtkIconView    *icon_view,
                                        GtkOrientation  orientation,
@@ -1467,7 +1473,7 @@ gtk_icon_view_get_preferred_item_size (GtkIconView    *icon_view,
   GtkCellAreaContext *context;
   GList *items;
 
-  if (priv->items == NULL)
+  if (gtk_icon_view_is_empty (icon_view))
     {
       *minimum = 1;
       *natural = 1;



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