[gtk+/treeview-refactor] Remove size_request from GtkToolbar
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/treeview-refactor] Remove size_request from GtkToolbar
- Date: Sat, 30 Oct 2010 08:33:36 +0000 (UTC)
commit bf75f63f490144e17ff88cc82e111dcd1f777603
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Oct 27 09:41:37 2010 -0400
Remove size_request from GtkToolbar
This is just a bandaid fix, the toolbar should really return proper
min/natural sizes, so that we can handle the overflow properly.
gtk/gtktoolbar.c | 36 +++++++++++++++++++++++++++++++++---
1 files changed, 33 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index c6f520c..007d039 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -186,8 +186,13 @@ static gint gtk_toolbar_draw (GtkWidget *widget,
cairo_t *cr);
static void gtk_toolbar_realize (GtkWidget *widget);
static void gtk_toolbar_unrealize (GtkWidget *widget);
-static void gtk_toolbar_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
+static void gtk_toolbar_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
+static void gtk_toolbar_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural);
+
static void gtk_toolbar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_toolbar_style_set (GtkWidget *widget,
@@ -363,7 +368,8 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
widget_class->button_press_event = gtk_toolbar_button_press;
widget_class->draw = gtk_toolbar_draw;
- widget_class->size_request = gtk_toolbar_size_request;
+ widget_class->get_preferred_width = gtk_toolbar_get_preferred_width;
+ widget_class->get_preferred_height = gtk_toolbar_get_preferred_height;
widget_class->size_allocate = gtk_toolbar_size_allocate;
widget_class->style_set = gtk_toolbar_style_set;
widget_class->focus = gtk_toolbar_focus;
@@ -994,6 +1000,30 @@ gtk_toolbar_size_request (GtkWidget *widget,
priv->button_maxh = max_homogeneous_child_height;
}
+static void
+gtk_toolbar_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ gtk_toolbar_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.width;
+}
+
+static void
+gtk_toolbar_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ gtk_toolbar_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.height;
+}
+
static gint
position (GtkToolbar *toolbar,
gint from,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]