diff options
Diffstat (limited to '')
-rw-r--r-- | widget/src/text/rich.rs | 2 | ||||
-rw-r--r-- | widget/src/text_editor.rs | 27 | ||||
-rw-r--r-- | widget/src/text_input.rs | 2 |
3 files changed, 16 insertions, 15 deletions
diff --git a/widget/src/text/rich.rs b/widget/src/text/rich.rs index 0b499ec6..a9e544d1 100644 --- a/widget/src/text/rich.rs +++ b/widget/src/text/rich.rs @@ -358,7 +358,7 @@ where fn update( &mut self, tree: &mut Tree, - event: Event, + event: &Event, layout: Layout<'_>, cursor: mouse::Cursor, _renderer: &Renderer, diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index cfdf6b5d..e685256b 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -651,7 +651,7 @@ where fn update( &mut self, tree: &mut widget::Tree, - event: Event, + event: &Event, layout: Layout<'_>, cursor: mouse::Cursor, renderer: &Renderer, @@ -686,17 +686,18 @@ where Event::Window(window::Event::RedrawRequested(now)) => { if let Some(focus) = &mut state.focus { if focus.is_window_focused { - focus.now = now; + focus.now = *now; let millis_until_redraw = Focus::CURSOR_BLINK_INTERVAL_MILLIS - - (now - focus.updated_at).as_millis() + - (focus.now - focus.updated_at).as_millis() % Focus::CURSOR_BLINK_INTERVAL_MILLIS; shell.request_redraw_at( - now + Duration::from_millis( - millis_until_redraw as u64, - ), + focus.now + + Duration::from_millis( + millis_until_redraw as u64, + ), ); } } @@ -1216,7 +1217,7 @@ enum Ime { impl<Message> Update<Message> { fn from_event<H: Highlighter>( - event: Event, + event: &Event, state: &State<H>, bounds: Rectangle, padding: Padding, @@ -1284,14 +1285,14 @@ impl<Message> Update<Message> { if state.focus.is_some() => { Some(Update::InputMethod(Ime::Preedit { - content, - selection, + content: content.clone(), + selection: selection.clone(), })) } input_method::Event::Commit(content) if state.focus.is_some() => { - Some(Update::InputMethod(Ime::Commit(content))) + Some(Update::InputMethod(Ime::Commit(content.clone()))) } _ => None, }, @@ -1310,9 +1311,9 @@ impl<Message> Update<Message> { }; let key_press = KeyPress { - key, - modifiers, - text, + key: key.clone(), + modifiers: *modifiers, + text: text.clone(), status, }; diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index b22ee1ca..215ecbd6 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -692,7 +692,7 @@ where fn update( &mut self, tree: &mut Tree, - event: Event, + event: &Event, layout: Layout<'_>, cursor: mouse::Cursor, renderer: &Renderer, |