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

@ -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),
}
}
}