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`].
|
/// Applies a [`widget::Operation`] to the [`Overlay`].
|
||||||
fn operate(
|
fn operate(
|
||||||
&self,
|
&mut self,
|
||||||
_layout: Layout<'_>,
|
_layout: Layout<'_>,
|
||||||
_operation: &mut dyn widget::Operation<Message>,
|
_operation: &mut dyn widget::Operation<Message>,
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ where
|
||||||
|
|
||||||
/// Applies a [`widget::Operation`] to the [`Element`].
|
/// Applies a [`widget::Operation`] to the [`Element`].
|
||||||
pub fn operate(
|
pub fn operate(
|
||||||
&self,
|
&mut self,
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
operation: &mut dyn widget::Operation<Message>,
|
operation: &mut dyn widget::Operation<Message>,
|
||||||
) {
|
) {
|
||||||
|
|
@ -142,7 +142,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn operate(
|
fn operate(
|
||||||
&self,
|
&mut self,
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
operation: &mut dyn widget::Operation<B>,
|
operation: &mut dyn widget::Operation<B>,
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -496,14 +496,19 @@ where
|
||||||
operation,
|
operation,
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(layout) = self.overlay.as_ref() {
|
if let Some(mut overlay) = self.root.as_widget_mut().overlay(
|
||||||
if let Some(overlay) = self.root.as_widget_mut().overlay(
|
&mut self.state,
|
||||||
&mut self.state,
|
Layout::new(&self.base),
|
||||||
Layout::new(&self.base),
|
renderer,
|
||||||
renderer,
|
) {
|
||||||
) {
|
if self.overlay.is_none() {
|
||||||
overlay.operate(Layout::new(layout), operation);
|
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