Resolve deferred size comparisons before allocating span slots
This commit is contained in:
1 parent
de1eb7e406
commit
8780b40bb7
23 files changed
+1471
-130
No files matched your search
@@ -8,6 +8,16 @@ pub struct Stack {
|
||||
}
|
||||
|
||||
impl Widget for Stack {
|
||||
fn size_request(&self, requests: &mut SizeRequests, axis: Axis) -> Option<RequestedLen> {
|
||||
match self.size {
|
||||
StackSize::Default => Some(LayoutLen::LEFTOVER.into()),
|
||||
StackSize::Child(i) => match self.children.get(i) {
|
||||
Some(child) => requests.widget(child, axis),
|
||||
None => Some(LayoutLen::LEFTOVER.into()),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
fn draw(&mut self, painter: &mut Painter) -> Size {
|
||||
let sizing = match self.size {
|
||||
StackSize::Default => None,
|
||||
|
||||
Reference in new issue
Block a user