Skip third flex pass entirely if main axis is compressed

This commit is contained in:
Héctor Ramón Jiménez 2025-08-21 18:16:46 +02:00
parent 7711b49f6b
commit 3ad578e248
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 50 additions and 48 deletions

View file

@ -94,14 +94,14 @@ impl Layout {
let controls = row([
(!self.example.is_first()).then_some(
button("← Previous")
button(text("← Previous").shaping(text::Shaping::Advanced))
.padding([5, 10])
.on_press(Message::Previous)
.into(),
),
Some(horizontal_space().into()),
(!self.example.is_last()).then_some(
button("Next →")
button(text("Next →").shaping(text::Shaping::Advanced))
.padding([5, 10])
.on_press(Message::Next)
.into(),
@ -294,7 +294,7 @@ fn quotes<'a>() -> Element<'a, Message> {
fn quote<'a>(
content: impl Into<Element<'a, Message>>,
) -> Element<'a, Message> {
row![vertical_rule(2), content.into()]
row![vertical_rule(1), content.into()]
.spacing(10)
.height(Shrink)
.into()
@ -313,7 +313,7 @@ fn quotes<'a>() -> Element<'a, Message> {
"This is another reply",
),
horizontal_rule(1),
"A separator ↑",
text("A separator ↑").shaping(text::Shaping::Advanced),
]
.width(Shrink)
.spacing(10)