diff options
author | Benjamin Otte <otte@redhat.com> | 2012-11-11 19:48:41 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-11-11 20:26:28 +0100 |
commit | a08eb4d58a758ac3c482695dd7ece2709e5fa227 (patch) | |
tree | 57da23825b661d22a37ec6af9a892400dd76ec87 | |
parent | 8449e05865b42a8c78b96f809b280aa5a4f044d8 (diff) | |
download | gtk+-a08eb4d58a758ac3c482695dd7ece2709e5fa227.tar.gz |
container: Simplify code
We will never get allocated a too small size, so no need to handle that
case.
-rw-r--r-- | gtk/gtkcontainer.c | 27 |
1 files changed, 3 insertions, 24 deletions
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; |