From 7979125ed793918dd4a0e5a1ddec8d17bffbd5bf Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 12 Feb 2025 08:46:35 +0100 Subject: Simplify `InputMethod` API with only two states Co-authored-by: rhysd Co-authored-by: KENZ --- widget/src/text_editor.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'widget/src/text_editor.rs') diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index ce5da9ef..7e40a56a 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -339,10 +339,6 @@ where return InputMethod::Disabled; }; - let Some(preedit) = &state.preedit else { - return InputMethod::Allowed; - }; - let bounds = layout.bounds(); let internal = self.content.0.borrow_mut(); @@ -363,10 +359,10 @@ where let position = cursor + translation + Vector::new(0.0, f32::from(line_height)); - InputMethod::Open { + InputMethod::Enabled { position, purpose: input_method::Purpose::Normal, - preedit: Some(preedit.as_ref()), + preedit: state.preedit.as_ref().map(input_method::Preedit::as_ref), } } } -- cgit