diff options
author | 2024-10-25 19:28:18 +0200 | |
---|---|---|
committer | 2024-11-05 23:52:58 +0100 | |
commit | dcc184b01b753dbecb500205391f6eaaa21c8683 (patch) | |
tree | 9f1854261c3b3805e28f524df65487c09c9729f7 /widget/src/text_editor.rs | |
parent | 752403d70c851ece620c4007710062b158e8dec3 (diff) | |
download | iced-dcc184b01b753dbecb500205391f6eaaa21c8683.tar.gz iced-dcc184b01b753dbecb500205391f6eaaa21c8683.tar.bz2 iced-dcc184b01b753dbecb500205391f6eaaa21c8683.zip |
Replace `event::Status` in `Widget::on_event` with `Shell::capture_event`
Diffstat (limited to 'widget/src/text_editor.rs')
-rw-r--r-- | widget/src/text_editor.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 3bb45494..292e584e 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -33,7 +33,6 @@ //! ``` use crate::core::alignment; use crate::core::clipboard::{self, Clipboard}; -use crate::core::event::{self, Event}; use crate::core::keyboard; use crate::core::keyboard::key; use crate::core::layout::{self, Layout}; @@ -47,7 +46,7 @@ use crate::core::widget::operation; use crate::core::widget::{self, Widget}; use crate::core::window; use crate::core::{ - Background, Border, Color, Element, Length, Padding, Pixels, Point, + Background, Border, Color, Element, Event, Length, Padding, Pixels, Point, Rectangle, Shell, Size, SmolStr, Theme, Vector, }; @@ -606,9 +605,9 @@ where clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, _viewport: &Rectangle, - ) -> event::Status { + ) { let Some(on_edit) = self.on_edit.as_ref() else { - return event::Status::Ignored; + return; }; let state = tree.state.downcast_mut::<State<Highlighter>>(); @@ -656,7 +655,7 @@ where cursor, self.key_binding.as_deref(), ) else { - return event::Status::Ignored; + return; }; match update { @@ -685,7 +684,7 @@ where let bounds = self.content.0.borrow().editor.bounds(); if bounds.height >= i32::MAX as f32 { - return event::Status::Ignored; + return; } let lines = lines + state.partial_scroll; @@ -798,7 +797,7 @@ where } } - event::Status::Captured + shell.capture_event(); } fn draw( |