diff options
author | 2025-02-12 07:26:26 +0100 | |
---|---|---|
committer | 2025-02-12 07:26:26 +0100 | |
commit | 7199ed0d079de5584ec0e7c8c5e8ff88cc1453e8 (patch) | |
tree | 744107232a7e366780cb31573e866ee60deeed45 /widget | |
parent | cf851e133ad6aaedaf07b58c68e7c41d41ee151a (diff) | |
download | iced-7199ed0d079de5584ec0e7c8c5e8ff88cc1453e8.tar.gz iced-7199ed0d079de5584ec0e7c8c5e8ff88cc1453e8.tar.bz2 iced-7199ed0d079de5584ec0e7c8c5e8ff88cc1453e8.zip |
Use default size for empty pre-edits
Diffstat (limited to 'widget')
-rw-r--r-- | widget/src/text_editor.rs | 7 | ||||
-rw-r--r-- | widget/src/text_input.rs | 9 |
2 files changed, 4 insertions, 12 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index ac458951..ce5da9ef 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -753,11 +753,8 @@ where } Update::InputMethod(update) => match update { Ime::Toggle(is_open) => { - state.preedit = is_open.then(|| { - let mut preedit = input_method::Preedit::new(); - preedit.text_size = self.text_size; - preedit - }); + state.preedit = + is_open.then(input_method::Preedit::new); shell.request_redraw(); } diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index 6d317490..37691e73 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -1261,13 +1261,8 @@ where let state = state::<Renderer>(tree); state.is_ime_open = - matches!(event, input_method::Event::Opened).then( - || { - let mut preedit = input_method::Preedit::new(); - preedit.text_size = self.size; - preedit - }, - ); + matches!(event, input_method::Event::Opened) + .then(input_method::Preedit::new); shell.request_redraw(); } |