[libhandy] stackable-box: Fix natural size calculation for deck
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy] stackable-box: Fix natural size calculation for deck
- Date: Mon, 1 Feb 2021 14:20:11 +0000 (UTC)
commit 354b5c5dcf746389cb0d8775a065df5b667b1549
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sat Jan 30 23:14:37 2021 +0500
stackable-box: Fix natural size calculation for deck
Fixes https://gitlab.gnome.org/GNOME/libhandy/-/issues/404
src/hdy-stackable-box.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/hdy-stackable-box.c b/src/hdy-stackable-box.c
index 5d222060..03debe6a 100644
--- a/src/hdy-stackable-box.c
+++ b/src/hdy-stackable-box.c
@@ -1343,6 +1343,7 @@ hdy_stackable_box_measure (HdyStackableBox *self,
gdouble visible_child_progress;
gint child_min, max_min, visible_min, last_visible_min;
gint child_nat, max_nat, sum_nat;
+ gboolean same_orientation;
void (*get_preferred_size_static) (GtkWidget *widget,
gint *minimum_width,
gint *natural_width);
@@ -1402,8 +1403,11 @@ hdy_stackable_box_measure (HdyStackableBox *self,
visible_child_progress = self->child_transition.interpolate_size ? self->child_transition.progress : 1.0;
+ same_orientation =
+ orientation == gtk_orientable_get_orientation (GTK_ORIENTABLE (self->container));
+
get_preferred_size (minimum, natural,
- gtk_orientable_get_orientation (GTK_ORIENTABLE (self->container)) == orientation,
+ same_orientation && self->can_unfold,
self->homogeneous[HDY_FOLD_FOLDED][orientation],
self->homogeneous[HDY_FOLD_UNFOLDED][orientation],
visible_children, visible_child_progress,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]