Implement Widget::operate for lazy::Cached
This commit is contained in:
parent
b5d33b0370
commit
54f9ab7d5f
1 changed files with 17 additions and 1 deletions
|
|
@ -4,8 +4,9 @@ use iced_native::mouse;
|
||||||
use iced_native::overlay;
|
use iced_native::overlay;
|
||||||
use iced_native::renderer;
|
use iced_native::renderer;
|
||||||
use iced_native::widget::tree::{self, Tree};
|
use iced_native::widget::tree::{self, Tree};
|
||||||
|
use iced_native::widget::{self, Widget};
|
||||||
|
use iced_native::Element;
|
||||||
use iced_native::{Clipboard, Hasher, Length, Point, Rectangle, Shell, Size};
|
use iced_native::{Clipboard, Hasher, Length, Point, Rectangle, Shell, Size};
|
||||||
use iced_native::{Element, Widget};
|
|
||||||
|
|
||||||
use ouroboros::self_referencing;
|
use ouroboros::self_referencing;
|
||||||
use std::cell::{Ref, RefCell, RefMut};
|
use std::cell::{Ref, RefCell, RefMut};
|
||||||
|
|
@ -125,6 +126,21 @@ where
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn operate(
|
||||||
|
&self,
|
||||||
|
tree: &mut Tree,
|
||||||
|
layout: Layout<'_>,
|
||||||
|
operation: &mut dyn widget::Operation<Message>,
|
||||||
|
) {
|
||||||
|
self.with_element(|element| {
|
||||||
|
element.as_widget().operate(
|
||||||
|
&mut tree.children[0],
|
||||||
|
layout,
|
||||||
|
operation,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
fn on_event(
|
fn on_event(
|
||||||
&mut self,
|
&mut self,
|
||||||
tree: &mut Tree,
|
tree: &mut Tree,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue