From 36e83663cf3ee151953267cc0bc163ec3d3f4af6 Mon Sep 17 00:00:00 2001 From: Jay Painter Date: Tue, 24 Mar 1998 08:52:41 +0000 Subject: [PATCH] Quick fix for size allocation -- needs more work overall --- gtk/gtkhandlebox.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index 04954b0ad0..2f3ce9b671 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -416,13 +416,23 @@ gtk_handle_box_size_allocate (GtkWidget *widget, hb = GTK_HANDLE_BOX (widget); widget->allocation.x = allocation->x; - if (allocation->height > widget->requisition.height) - widget->allocation.y = allocation->y + (allocation->height - widget->requisition.height) / 2; + + if (hb->child_detached) + { + if (allocation->height > widget->requisition.height) + widget->allocation.y = allocation->y + + (allocation->height - widget->requisition.height) / 2; + else + widget->allocation.y = allocation->y; + + widget->allocation.height = MIN (allocation->height, widget->requisition.height); + widget->allocation.width = MIN (allocation->width, widget->requisition.width); + } else - widget->allocation.y = allocation->y; - widget->allocation.height = MIN (allocation->height, widget->requisition.height); - widget->allocation.width = MIN (allocation->width, widget->requisition.width); - + { + widget->allocation = *allocation; + } + if (GTK_WIDGET_REALIZED (hb)) gdk_window_move_resize (widget->window, widget->allocation.x,