[gtk+/treeview-refactor] Removed size_request from GtkIconView.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/treeview-refactor] Removed size_request from GtkIconView.
- Date: Sat, 30 Oct 2010 08:32:26 +0000 (UTC)
commit 8565b86223cfbf08c7eb23f4272f152c752add7d
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Wed Oct 27 14:11:36 2010 +0900
Removed size_request from GtkIconView.
gtk/gtkiconview.c | 42 +++++++++++++++++++-----------------------
1 files changed, 19 insertions(+), 23 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index de282d0..6345682 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -272,8 +272,12 @@ static void gtk_icon_view_style_set (GtkWidget
GtkStyle *previous_style);
static void gtk_icon_view_state_changed (GtkWidget *widget,
GtkStateType previous_state);
-static void gtk_icon_view_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
+static void gtk_icon_view_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
+static void gtk_icon_view_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
static void gtk_icon_view_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean gtk_icon_view_draw (GtkWidget *widget,
@@ -531,7 +535,8 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
widget_class->unrealize = gtk_icon_view_unrealize;
widget_class->style_set = gtk_icon_view_style_set;
widget_class->get_accessible = gtk_icon_view_get_accessible;
- widget_class->size_request = gtk_icon_view_size_request;
+ widget_class->get_preferred_width = gtk_icon_view_get_preferred_width;
+ widget_class->get_preferred_height = gtk_icon_view_get_preferred_height;
widget_class->size_allocate = gtk_icon_view_size_allocate;
widget_class->draw = gtk_icon_view_draw;
widget_class->motion_notify_event = gtk_icon_view_motion;
@@ -1458,28 +1463,19 @@ gtk_icon_view_style_set (GtkWidget *widget,
}
static void
-gtk_icon_view_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
+gtk_icon_view_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
{
- GtkIconView *icon_view = GTK_ICON_VIEW (widget);
- GList *tmp_list;
-
- requisition->width = icon_view->priv->width;
- requisition->height = icon_view->priv->height;
-
- tmp_list = icon_view->priv->children;
-
- while (tmp_list)
- {
- GtkIconViewChild *child = tmp_list->data;
- GtkRequisition child_requisition;
-
- tmp_list = tmp_list->next;
+ *minimum = *natural = GTK_ICON_VIEW (widget)->priv->width;
+}
- if (gtk_widget_get_visible (child->widget))
- gtk_widget_get_preferred_size (child->widget,
- &child_requisition, NULL);
- }
+static void
+gtk_icon_view_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ *minimum = *natural = GTK_ICON_VIEW (widget)->priv->height;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]