diff options
author | 2023-03-16 20:23:25 +0100 | |
---|---|---|
committer | 2024-01-04 06:51:21 +0100 | |
commit | 0655a20ad119e2e9790afcc45039fd4ac0e7d432 (patch) | |
tree | 0ce316e386e5b47b6ca80fe16f0a384ef05ff4e8 /examples/modal | |
parent | 68c0484b5cf6f572e4cb0bf72c22c1a93dbb654e (diff) | |
download | iced-0655a20ad119e2e9790afcc45039fd4ac0e7d432.tar.gz iced-0655a20ad119e2e9790afcc45039fd4ac0e7d432.tar.bz2 iced-0655a20ad119e2e9790afcc45039fd4ac0e7d432.zip |
Make `Shrink` have priority over `Fill` in layout
Diffstat (limited to 'examples/modal')
-rw-r--r-- | examples/modal/src/main.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/modal/src/main.rs b/examples/modal/src/main.rs index acb14372..85ccf8b4 100644 --- a/examples/modal/src/main.rs +++ b/examples/modal/src/main.rs @@ -420,17 +420,14 @@ mod modal { .width(Length::Fill) .height(Length::Fill); - let mut child = self + let child = self .content .as_widget() - .layout(self.tree, renderer, &limits); + .layout(self.tree, renderer, &limits) + .align(Alignment::Center, Alignment::Center, limits.max()); - child.align(Alignment::Center, Alignment::Center, limits.max()); - - let mut node = layout::Node::with_children(self.size, vec![child]); - node.move_to(position); - - node + layout::Node::with_children(self.size, vec![child]) + .move_to(position) } fn on_event( |