diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-10-27 22:50:24 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-10-27 22:51:35 +0900 |
commit | 7a85a31cc46401a1d96636053f145a07a6db7f64 (patch) | |
tree | 0a1241d89609fdfba860a66cd8894764aa50b11f /gtk/gtktoolpalette.c | |
parent | 1205f5a2308953322e8a9ed6d34874ebfca84e63 (diff) | |
download | gtk+-7a85a31cc46401a1d96636053f145a07a6db7f64.tar.gz |
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.
Diffstat (limited to 'gtk/gtktoolpalette.c')
-rw-r--r-- | gtk/gtktoolpalette.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c index bc60c3d210..1fb8aee806 100644 --- a/gtk/gtktoolpalette.c +++ b/gtk/gtktoolpalette.c @@ -436,6 +436,31 @@ gtk_tool_palette_size_request (GtkWidget *widget, } 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; |