Provide a way to set cursor area for IME cursor
Rename `Window::set_ime_position` to `Window::set_ime_cursor_area` adding a way to create cursor exclusive zone. Fixes #2886.
This commit is contained in:
parent
66ff52b012
commit
05444628e6
17 changed files with 72 additions and 43 deletions
|
|
@ -3,7 +3,7 @@
|
|||
use log::LevelFilter;
|
||||
use simple_logger::SimpleLogger;
|
||||
use winit::{
|
||||
dpi::PhysicalPosition,
|
||||
dpi::{PhysicalPosition, PhysicalSize},
|
||||
event::{ElementState, Event, Ime, WindowEvent},
|
||||
event_loop::{ControlFlow, EventLoop},
|
||||
keyboard::{Key, KeyCode},
|
||||
|
|
@ -66,7 +66,7 @@ fn main() {
|
|||
);
|
||||
ime_pos = cursor_position;
|
||||
if may_show_ime {
|
||||
window.set_ime_position(ime_pos);
|
||||
window.set_ime_cursor_area(ime_pos, PhysicalSize::new(10, 10));
|
||||
}
|
||||
}
|
||||
Event::WindowEvent {
|
||||
|
|
@ -76,7 +76,7 @@ fn main() {
|
|||
println!("{event:?}");
|
||||
may_show_ime = event != Ime::Disabled;
|
||||
if may_show_ime {
|
||||
window.set_ime_position(ime_pos);
|
||||
window.set_ime_cursor_area(ime_pos, PhysicalSize::new(10, 10));
|
||||
}
|
||||
}
|
||||
Event::WindowEvent {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue