Simplify InputMethod API with only two states

Co-authored-by: rhysd <lin90162@yahoo.co.jp>
Co-authored-by: KENZ <KENZ.gelsoft@gmail.com>
This commit is contained in:
Héctor Ramón Jiménez 2025-02-12 08:46:35 +01:00
parent 97f1db3783
commit 7979125ed7
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 113 additions and 100 deletions

View file

@ -729,7 +729,7 @@ where
_ => mouse::Cursor::Unavailable,
};
let had_input_method = shell.input_method().is_open();
let had_input_method = shell.input_method().is_enabled();
let translation =
state.translation(self.direction, bounds, content_bounds);
@ -750,7 +750,7 @@ where
);
if !had_input_method {
if let InputMethod::Open { position, .. } =
if let InputMethod::Enabled { position, .. } =
shell.input_method_mut()
{
*position = *position - translation;