[gtk+/composite-templates] iconview: Add a descriptive function
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/composite-templates] iconview: Add a descriptive function
- Date: Tue, 26 Jun 2012 22:36:23 +0000 (UTC)
commit 73a5f9c23aa9a6590388f90d1f739595d85beaf8
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]