mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
app,widget,io: implement IME positioning
This change implements reporting of the caret position from Editor, as well as Windows, macOS, Android support. As a result, the IME composition window on Windows and macOS is now positioned correctly. References: https://todo.sr.ht/~eliasnaur/gio/246 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-1
@@ -78,7 +78,7 @@ func FuzzIME(f *testing.F) {
|
||||
if rng.End > len(runes) {
|
||||
rng.End = len(runes)
|
||||
}
|
||||
state.Selection = rng
|
||||
state.Selection.Range = rng
|
||||
case cmdSnip:
|
||||
r.Queue(key.SnippetEvent(rng))
|
||||
runes := []rune(e.Text())
|
||||
@@ -106,6 +106,8 @@ func FuzzIME(f *testing.F) {
|
||||
e.Layout(gtx, cache, text.Font{}, unit.Px(10), nil)
|
||||
r.Frame(gtx.Ops)
|
||||
newState := r.EditorState()
|
||||
// We don't track caret position.
|
||||
state.Selection.Caret = newState.Selection.Caret
|
||||
if newState != state.EditorState {
|
||||
t.Errorf("IME state: %+v\neditor state: %+v", state.EditorState, newState)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user