mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Merge a6ea1976cf
into 5ef66ce386
This commit is contained in:
commit
57855552e3
3 changed files with 13 additions and 9 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -5391,8 +5391,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ohos-ime"
|
name = "ohos-ime"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ee3ea454e31a3372cd9c4ed903db4fae861e92f57cf51852a3cd80f9d3945dcd"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"ohos-ime-sys",
|
"ohos-ime-sys",
|
||||||
|
@ -5400,9 +5398,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ohos-ime-sys"
|
name = "ohos-ime-sys"
|
||||||
version = "0.1.4"
|
version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "58f68e03eb5b698781a69dc4918a17fe040a30be87de7014c12e4a2a3cb8a00f"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ohos-sys-opaque-types"
|
name = "ohos-sys-opaque-types"
|
||||||
|
|
|
@ -91,7 +91,7 @@ ipc-channel = { workspace = true, features = ["force-inprocess"] }
|
||||||
napi-derive-ohos = "1.0.4"
|
napi-derive-ohos = "1.0.4"
|
||||||
napi-ohos = "1.0.4"
|
napi-ohos = "1.0.4"
|
||||||
ohos-ime = "0.3.0"
|
ohos-ime = "0.3.0"
|
||||||
ohos-ime-sys = "0.1.4"
|
ohos-ime-sys = "0.2.0"
|
||||||
ohos-vsync = "0.1.3"
|
ohos-vsync = "0.1.3"
|
||||||
xcomponent-sys = { version = "0.3.1", features = ["api-12", "keyboard-types"] }
|
xcomponent-sys = { version = "0.3.1", features = ["api-12", "keyboard-types"] }
|
||||||
|
|
||||||
|
|
|
@ -867,14 +867,22 @@ impl HostTrait for HostCallbacks {
|
||||||
let mut ime_proxy = self.ime_proxy.borrow_mut();
|
let mut ime_proxy = self.ime_proxy.borrow_mut();
|
||||||
let ime = ime_proxy.get_or_insert_with(|| {
|
let ime = ime_proxy.get_or_insert_with(|| {
|
||||||
let attach_options = AttachOptions::new(true);
|
let attach_options = AttachOptions::new(true);
|
||||||
let configbuilder = ohos_ime::TextConfigBuilder::new();
|
|
||||||
let options = convert_ime_options(input_type, multiline);
|
let options = convert_ime_options(input_type, multiline);
|
||||||
let text_config = configbuilder
|
let text_config = ohos_ime::TextConfigBuilder::new()
|
||||||
.input_type(options.input_type)
|
.input_type(options.input_type)
|
||||||
.enterkey_type(options.enterkey_type)
|
.enterkey_type(options.enterkey_type)
|
||||||
.build();
|
.build();
|
||||||
let editor = RawTextEditorProxy::new(Box::new(ServoIme { text_config }));
|
let editor = RawTextEditorProxy::new(Box::new(ServoIme { text_config }))
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Failed to create RawTextEditorProxy: {:?}", e);
|
||||||
|
return;
|
||||||
|
})
|
||||||
|
.unwrap();
|
||||||
ImeProxy::new(editor, attach_options)
|
ImeProxy::new(editor, attach_options)
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Failed to create IME proxy: {:?}", e);
|
||||||
|
})
|
||||||
|
.unwrap()
|
||||||
});
|
});
|
||||||
match ime.show_keyboard() {
|
match ime.show_keyboard() {
|
||||||
Ok(()) => debug!("IME show keyboard - success"),
|
Ok(()) => debug!("IME show keyboard - success"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue