Get widget operations working w/ overlay
This commit is contained in:
parent
23da5a3251
commit
9a601c0954
3 changed files with 15 additions and 10 deletions
|
|
@ -44,7 +44,7 @@ where
|
|||
|
||||
/// Applies a [`widget::Operation`] to the [`Overlay`].
|
||||
fn operate(
|
||||
&self,
|
||||
&mut self,
|
||||
_layout: Layout<'_>,
|
||||
_operation: &mut dyn widget::Operation<Message>,
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ where
|
|||
|
||||
/// Applies a [`widget::Operation`] to the [`Element`].
|
||||
pub fn operate(
|
||||
&self,
|
||||
&mut self,
|
||||
layout: Layout<'_>,
|
||||
operation: &mut dyn widget::Operation<Message>,
|
||||
) {
|
||||
|
|
@ -142,7 +142,7 @@ where
|
|||
}
|
||||
|
||||
fn operate(
|
||||
&self,
|
||||
&mut self,
|
||||
layout: Layout<'_>,
|
||||
operation: &mut dyn widget::Operation<B>,
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -496,14 +496,19 @@ where
|
|||
operation,
|
||||
);
|
||||
|
||||
if let Some(layout) = self.overlay.as_ref() {
|
||||
if let Some(overlay) = self.root.as_widget_mut().overlay(
|
||||
&mut self.state,
|
||||
Layout::new(&self.base),
|
||||
renderer,
|
||||
) {
|
||||
overlay.operate(Layout::new(layout), operation);
|
||||
if let Some(mut overlay) = self.root.as_widget_mut().overlay(
|
||||
&mut self.state,
|
||||
Layout::new(&self.base),
|
||||
renderer,
|
||||
) {
|
||||
if self.overlay.is_none() {
|
||||
self.overlay = Some(overlay.layout(renderer, self.bounds));
|
||||
}
|
||||
|
||||
overlay.operate(
|
||||
Layout::new(self.overlay.as_ref().unwrap()),
|
||||
operation,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue