summaryrefslogtreecommitdiffstats
path: root/examples/toast
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-16 20:23:25 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-04 06:51:21 +0100
commit0655a20ad119e2e9790afcc45039fd4ac0e7d432 (patch)
tree0ce316e386e5b47b6ca80fe16f0a384ef05ff4e8 /examples/toast
parent68c0484b5cf6f572e4cb0bf72c22c1a93dbb654e (diff)
downloadiced-0655a20ad119e2e9790afcc45039fd4ac0e7d432.tar.gz
iced-0655a20ad119e2e9790afcc45039fd4ac0e7d432.tar.bz2
iced-0655a20ad119e2e9790afcc45039fd4ac0e7d432.zip
Make `Shrink` have priority over `Fill` in layout
Diffstat (limited to 'examples/toast')
-rw-r--r--examples/toast/src/main.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/examples/toast/src/main.rs b/examples/toast/src/main.rs
index 31b6f191..711d8223 100644
--- a/examples/toast/src/main.rs
+++ b/examples/toast/src/main.rs
@@ -106,9 +106,7 @@ impl Application for App {
fn view<'a>(&'a self) -> Element<'a, Message> {
let subtitle = |title, content: Element<'a, Message>| {
- column![text(title).size(14), content]
- .width(Length::Fill)
- .spacing(5)
+ column![text(title).size(14), content].spacing(5)
};
let mut add_toast = button("Add Toast");
@@ -153,14 +151,11 @@ impl Application for App {
Message::Timeout
)
.step(1.0)
- .width(Length::Fill)
]
.spacing(5)
.into()
),
- column![add_toast]
- .width(Length::Fill)
- .align_items(Alignment::End)
+ column![add_toast].align_items(Alignment::End)
]
.spacing(10)
.max_width(200),
@@ -513,14 +508,14 @@ mod toast {
position: Point,
_translation: Vector,
) -> layout::Node {
- let limits = layout::Limits::new(Size::ZERO, bounds)
- .width(Length::Fill)
- .height(Length::Fill);
+ let limits = layout::Limits::new(Size::ZERO, bounds);
layout::flex::resolve(
layout::flex::Axis::Vertical,
renderer,
&limits,
+ Length::Fill,
+ Length::Fill,
10.into(),
10.0,
Alignment::End,