diff options
author | Benjamin Otte <otte@redhat.com> | 2012-06-14 18:52:09 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-06-14 18:52:09 +0200 |
commit | c187386fe1a66cc9f37dc5d4abdb06ee257ace12 (patch) | |
tree | 25b68664f61ec9008621d60d2a2ea97a1e8ecddf /gtk/gtkiconview.c | |
parent | fd4c330500e3b4b6318addfeabc42c9c57d69dea (diff) | |
download | gtk+-c187386fe1a66cc9f37dc5d4abdb06ee257ace12.tar.gz |
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.
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r-- | gtk/gtkiconview.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index cd580f3030..848ccabc42 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; |