Removing size_request from GtkToolPalette

Note GtkToolPalette is internally height-for-width, it needs to
be refactored to cooperate with GTK+'s height-for-width geometry
management properly.
This commit is contained in:
Tristan Van Berkom 2010-10-27 22:50:24 +09:00
parent bf75f63f49
commit 0b3e2ffee6

View File

@ -435,6 +435,31 @@ gtk_tool_palette_size_request (GtkWidget *widget,
requisition->height += border_width * 2;
}
static void
gtk_tool_palette_get_preferred_width (GtkWidget *widget,
gint *minimum,
gint *natural)
{
GtkRequisition requisition;
gtk_tool_palette_size_request (widget, &requisition);
*minimum = *natural = requisition.width;
}
static void
gtk_tool_palette_get_preferred_height (GtkWidget *widget,
gint *minimum,
gint *natural)
{
GtkRequisition requisition;
gtk_tool_palette_size_request (widget, &requisition);
*minimum = *natural = requisition.height;
}
static void
gtk_tool_palette_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@ -961,7 +986,8 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
oclass->dispose = gtk_tool_palette_dispose;
oclass->finalize = gtk_tool_palette_finalize;
wclass->size_request = gtk_tool_palette_size_request;
wclass->get_preferred_width = gtk_tool_palette_get_preferred_width;
wclass->get_preferred_height= gtk_tool_palette_get_preferred_height;
wclass->size_allocate = gtk_tool_palette_size_allocate;
wclass->draw = gtk_tool_palette_draw;
wclass->realize = gtk_tool_palette_realize;