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:
parent
97f1db3783
commit
7979125ed7
8 changed files with 113 additions and 100 deletions
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue