diff options
author | Timm Bäder <mail@baedert.org> | 2017-07-05 11:09:27 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-19 21:27:15 -0400 |
commit | 1e4d11b99565df6f7be95e874f2661244c9de52c (patch) | |
tree | 3ce9248166d279a65d7d374b1b019e01bca1509c /gtk | |
parent | 68c35bbe15435f0e1a2d075dbd06e479fdc7643f (diff) | |
download | gtk+-1e4d11b99565df6f7be95e874f2661244c9de52c.tar.gz |
box: Ignore baselines when vertical
For now.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkbox.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index d71aa48b80..86a9ba55f9 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -385,7 +385,7 @@ gtk_box_size_allocate_no_center (GtkWidget *widget, gint minimum_above, natural_above; gint minimum_below, natural_below; gboolean have_baseline; - gint baseline; + int baseline = -1; GtkPackType packing; @@ -522,7 +522,7 @@ gtk_box_size_allocate_no_center (GtkWidget *widget, sizes[i].natural_size = child_size; if (private->orientation == GTK_ORIENTATION_HORIZONTAL && - gtk_widget_get_valign (child->widget) == GTK_ALIGN_BASELINE) + gtk_widget_get_valign (child->widget) == GTK_ALIGN_BASELINE) { int child_allocation_width; int child_minimum_height, child_natural_height; @@ -550,7 +550,11 @@ gtk_box_size_allocate_no_center (GtkWidget *widget, } } - baseline = gtk_widget_get_allocated_baseline (widget); + if (private->orientation == GTK_ORIENTATION_HORIZONTAL) + baseline = gtk_widget_get_allocated_baseline (widget); + + /* we only calculate our own baseline if we don't get one passed from the parent + * and any of the child widgets explicitly request one */ if (baseline == -1 && have_baseline) { gint height = MAX (1, allocation->height); |