[libhandy] stackable-box: Don't fold with only 1 visible child
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy] stackable-box: Don't fold with only 1 visible child
- Date: Fri, 12 Jun 2020 16:42:58 +0000 (UTC)
commit efb36a1023acf09c679d2496e756b6112bb38694
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Jun 12 18:43:25 2020 +0500
stackable-box: Don't fold with only 1 visible child
Now that children with 0 size are skipped, we can make sure that we only
ever do folding when there's a reason to. So only do it when there is more
than one child that doesn't have 0 size.
Signed-off-by: Alexander Mikhaylenko <alexm gnome org>
src/hdy-stackable-box.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/hdy-stackable-box.c b/src/hdy-stackable-box.c
index dd64e091..33a7a846 100644
--- a/src/hdy-stackable-box.c
+++ b/src/hdy-stackable-box.c
@@ -2062,7 +2062,7 @@ hdy_stackable_box_size_allocate (HdyStackableBox *self,
}
if (self->homogeneous[HDY_FOLD_UNFOLDED][GTK_ORIENTATION_HORIZONTAL])
nat_box_size = nat_max_size * visible_children;
- folded = allocation->width < nat_box_size;
+ folded = visible_children > 1 && allocation->width < nat_box_size;
}
else {
for (children = directed_children; children; children = children->next) {
@@ -2081,7 +2081,7 @@ hdy_stackable_box_size_allocate (HdyStackableBox *self,
}
if (self->homogeneous[HDY_FOLD_UNFOLDED][GTK_ORIENTATION_VERTICAL])
nat_box_size = nat_max_size * visible_children;
- folded = allocation->height < nat_box_size;
+ folded = visible_children > 1 && allocation->height < nat_box_size;
}
folded |= !self->can_unfold;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]