[gtk+/kill-size-request] Remove size_request from GtkSeparatorToolItem
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/kill-size-request] Remove size_request from GtkSeparatorToolItem
- Date: Wed, 27 Oct 2010 14:18:45 +0000 (UTC)
commit 8f9807ac15cd416a93dbd69c2fcf0e826876af2d
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Oct 27 10:17:58 2010 -0400
Remove size_request from GtkSeparatorToolItem
gtk/gtkseparatortoolitem.c | 54 ++++++++++++++++++++++++++++++-------------
1 files changed, 37 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c
index d8ebb63..1d81d3b 100644
--- a/gtk/gtkseparatortoolitem.c
+++ b/gtk/gtkseparatortoolitem.c
@@ -66,8 +66,12 @@ static void gtk_separator_tool_item_get_property (GObject
guint prop_id,
GValue *value,
GParamSpec *pspec);
-static void gtk_separator_tool_item_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
+static void gtk_separator_tool_item_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
+static void gtk_separator_tool_item_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
static void gtk_separator_tool_item_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean gtk_separator_tool_item_draw (GtkWidget *widget,
@@ -118,7 +122,8 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
object_class->set_property = gtk_separator_tool_item_set_property;
object_class->get_property = gtk_separator_tool_item_get_property;
- widget_class->size_request = gtk_separator_tool_item_size_request;
+ widget_class->get_preferred_width = gtk_separator_tool_item_get_preferred_width;
+ widget_class->get_preferred_height = gtk_separator_tool_item_get_preferred_height;
widget_class->size_allocate = gtk_separator_tool_item_size_allocate;
widget_class->draw = gtk_separator_tool_item_draw;
widget_class->realize = gtk_separator_tool_item_realize;
@@ -213,22 +218,37 @@ gtk_separator_tool_item_get_property (GObject *object,
}
static void
-gtk_separator_tool_item_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
+gtk_separator_tool_item_get_preferred_size (GtkWidget *widget,
+ GtkOrientation orientation,
+ gint *minimum,
+ gint *natural)
{
- GtkToolItem *item = GTK_TOOL_ITEM (widget);
- GtkOrientation orientation = gtk_tool_item_get_orientation (item);
-
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- requisition->width = get_space_size (item);
- requisition->height = 1;
- }
+ if (gtk_tool_item_get_orientation (GTK_TOOL_ITEM (widget)) == orientation)
+ *minimum = *natural = get_space_size (GTK_TOOL_ITEM (widget));
else
- {
- requisition->height = get_space_size (item);
- requisition->width = 1;
- }
+ *minimum = *natural = 1;
+}
+
+static void
+gtk_separator_tool_item_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ gtk_separator_tool_item_get_preferred_size (widget,
+ GTK_ORIENTATION_HORIZONTAL,
+ minimum,
+ natural);
+}
+
+static void
+gtk_separator_tool_item_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ gtk_separator_tool_item_get_preferred_size (widget,
+ GTK_ORIENTATION_VERTICAL,
+ minimum,
+ natural);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]