diff --git a/src/native/card.rs b/src/native/card.rs index a3cfc5da..e428f81f 100644 --- a/src/native/card.rs +++ b/src/native/card.rs @@ -559,6 +559,30 @@ where &self.style, ); } + + fn overlay<'b>( + &'b mut self, + tree: &'b mut Tree, + layout: Layout<'_>, + renderer: &Renderer, + ) -> Option> { + let mut children = vec![&mut self.head, &mut self.body]; + if let Some(foot) = &mut self.foot { + children.push(foot); + } + let children = children + .into_iter() + .zip(&mut tree.children) + .zip(layout.children()) + .filter_map(|((child, state), layout)| { + layout.children().next().and_then(|child_layout| { + child.as_widget_mut().overlay(state, child_layout, renderer) + }) + }) + .collect::>(); + + (!children.is_empty()).then(|| core::overlay::Group::with_children(children).overlay()) + } } /// Calculates the layout of the head.