Implement Widget::operate for TextInput
This commit is contained in:
parent
80688689aa
commit
52f84e51e9
12 changed files with 178 additions and 22 deletions
|
|
@ -4,7 +4,7 @@ use crate::layout;
|
|||
use crate::mouse;
|
||||
use crate::overlay;
|
||||
use crate::renderer;
|
||||
use crate::widget::Tree;
|
||||
use crate::widget::{Operation, Tree};
|
||||
use crate::{
|
||||
Alignment, Clipboard, Element, Layout, Length, Padding, Point, Rectangle,
|
||||
Shell, Widget,
|
||||
|
|
@ -143,6 +143,23 @@ where
|
|||
)
|
||||
}
|
||||
|
||||
fn operate(
|
||||
&self,
|
||||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
operation: &mut dyn Operation<Message>,
|
||||
) {
|
||||
operation.container(None, &mut |operation| {
|
||||
self.children
|
||||
.iter()
|
||||
.zip(&mut tree.children)
|
||||
.zip(layout.children())
|
||||
.for_each(|((child, state), layout)| {
|
||||
child.as_widget().operate(state, layout, operation);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
fn on_event(
|
||||
&mut self,
|
||||
tree: &mut Tree,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue