diff options
| author | 2025-02-03 16:55:10 +0100 | |
|---|---|---|
| committer | 2025-02-03 16:55:10 +0100 | |
| commit | e8c680ce66b6b766a196e799b209e73e0bf416ab (patch) | |
| tree | a53a4fcd63ba5ed2eae5abd15b591c5467029f08 /widget | |
| parent | 76c25d2fb2a6d83c6dbb71a92c184209c1d36acc (diff) | |
| download | iced-e8c680ce66b6b766a196e799b209e73e0bf416ab.tar.gz iced-e8c680ce66b6b766a196e799b209e73e0bf416ab.tar.bz2 iced-e8c680ce66b6b766a196e799b209e73e0bf416ab.zip | |
Request redraws on `InputMethod` events
Diffstat (limited to 'widget')
| -rw-r--r-- | widget/src/text_editor.rs | 4 | ||||
| -rw-r--r-- | widget/src/text_input.rs | 6 | 
2 files changed, 9 insertions, 1 deletions
| diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 26d05ccd..486741c6 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -754,6 +754,8 @@ where                      Ime::Toggle(is_open) => {                          state.preedit =                              is_open.then(input_method::Preedit::new); + +                        shell.request_redraw();                      }                      Ime::Preedit { content, selection } => {                          if state.focus.is_some() { @@ -761,6 +763,8 @@ where                                  content,                                  selection,                              }); + +                            shell.request_redraw();                          }                      }                      Ime::Commit(text) => { diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index 4c9e46c1..b22ee1ca 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -36,13 +36,13 @@ mod value;  pub mod cursor;  pub use cursor::Cursor; -use iced_runtime::core::input_method;  pub use value::Value;  use editor::Editor;  use crate::core::alignment;  use crate::core::clipboard::{self, Clipboard}; +use crate::core::input_method;  use crate::core::keyboard;  use crate::core::keyboard::key;  use crate::core::layout; @@ -1257,6 +1257,8 @@ where                      state.is_ime_open =                          matches!(event, input_method::Event::Opened)                              .then(input_method::Preedit::new); + +                    shell.request_redraw();                  }                  input_method::Event::Preedit(content, selection) => {                      let state = state::<Renderer>(tree); @@ -1266,6 +1268,8 @@ where                              content: content.to_owned(),                              selection: selection.clone(),                          }); + +                        shell.request_redraw();                      }                  }                  input_method::Event::Commit(text) => { | 
