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.
This commit is contained in:
Matthias Clasen 2010-10-27 09:41:37 -04:00 committed by Tristan Van Berkom
parent f3d5e20cff
commit bf75f63f49

View File

@ -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,