diff options
author | Paolo Borelli <pborelli@gnome.org> | 2014-02-17 23:19:10 +0100 |
---|---|---|
committer | Paolo Borelli <pborelli@gnome.org> | 2014-02-17 23:23:04 +0100 |
commit | ad9019c2c930f0a7310d3861e1bff82758e576b4 (patch) | |
tree | ef8522d1add6ac7d78ca1a06e07d294436866eb6 /gtk/gtkbox.c | |
parent | ae4abbcb9d19c29a6f269aa3b0932a5616b4874b (diff) | |
download | gtk+-ad9019c2c930f0a7310d3861e1bff82758e576b4.tar.gz |
gtkbox: fix positioning of center widget
Diffstat (limited to 'gtk/gtkbox.c')
-rw-r--r-- | gtk/gtkbox.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 19bb0f96e6..062008130f 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -1137,7 +1137,11 @@ gtk_box_size_allocate_with_center (GtkWidget *widget, } /* Allocate the center widget */ - center_pos = (box_size - center_size) / 2; + if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) + center_pos = allocation->x + (box_size - center_size) / 2; + else + center_pos = allocation->y + (box_size - center_size) / 2; + if (center_pos < side[GTK_PACK_START]) center_pos = side[GTK_PACK_START]; else if (center_pos + center_size > side[GTK_PACK_END]) |