From a08eb4d58a758ac3c482695dd7ece2709e5fa227 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 11 Nov 2012 19:48:41 +0100 Subject: container: Simplify code We will never get allocated a too small size, so no need to handle that case. --- gtk/gtkcontainer.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'gtk/gtkcontainer.c') diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index f985173b59..52eeae8b97 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1918,32 +1918,11 @@ gtk_container_adjust_size_allocation (GtkWidget *widget, container = GTK_CONTAINER (widget); - if (!GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width) + if (GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width) { - parent_class->adjust_size_allocation (widget, orientation, - minimum_size, natural_size, allocated_pos, - allocated_size); - return; - } - - border_width = container->priv->border_width; - - *allocated_size -= border_width * 2; - - /* If we get a pathological too-small allocation to hold - * even the border width, leave all allocation to the actual - * widget, and leave x,y unchanged. (GtkWidget's min size is - * 1x1 if you're wondering why <1 and not <0) - * - * As long as we have space, set x,y properly. - */ + border_width = container->priv->border_width; - if (*allocated_size < 1) - { - *allocated_size += border_width * 2; - } - else - { + *allocated_size -= border_width * 2; *allocated_pos += border_width; *minimum_size -= border_width * 2; *natural_size -= border_width * 2; -- cgit v1.2.1