Implement Widget::operate for TextInput
This commit is contained in:
parent
80688689aa
commit
52f84e51e9
12 changed files with 178 additions and 22 deletions
|
|
@ -8,6 +8,7 @@ use crate::overlay;
|
|||
use crate::renderer;
|
||||
use crate::touch;
|
||||
use crate::widget::tree::{self, Tree};
|
||||
use crate::widget::Operation;
|
||||
use crate::{
|
||||
Background, Clipboard, Color, Element, Layout, Length, Padding, Point,
|
||||
Rectangle, Shell, Vector, Widget,
|
||||
|
|
@ -164,6 +165,21 @@ where
|
|||
)
|
||||
}
|
||||
|
||||
fn operate(
|
||||
&self,
|
||||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
operation: &mut dyn Operation<Message>,
|
||||
) {
|
||||
operation.container(None, &mut |operation| {
|
||||
self.content.as_widget().operate(
|
||||
&mut tree.children[0],
|
||||
layout.children().next().unwrap(),
|
||||
operation,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
fn on_event(
|
||||
&mut self,
|
||||
tree: &mut Tree,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue