Initial input method support for the winit backend and the FemtoVG/Skia renderers

Known caveats:

- winit doesn't forward mouse events to the IME, so clicking
  with the mouse while composing results in funny effects such
  as the pre-edit text following the cursor.
- With FemtoVG there's no text decoration support, thus no underlining
  of the preedit area.
This commit is contained in:
Simon Hausmann 2022-10-06 11:08:27 +02:00 committed by Simon Hausmann
parent c40b82c509
commit 8cba0622f5
17 changed files with 285 additions and 83 deletions

View file

@ -223,6 +223,7 @@ export TextInput := _ {
property <bool> enabled: true;
property <bool> single-line: true;
property <bool> read-only: false;
property <string> preedit-text: native_output;
//-default_size_binding:expands_to_parent_geometry
//-accepts_focus
}

View file

@ -40,7 +40,7 @@ export LineEditInner := Rectangle {
placeholder := Text {
height: 100%; width: 100%;
vertical-alignment: center;
text: root.text == "" ? root.placeholder-text : "";
text: (root.text == "" && input.preedit-text == "") ? root.placeholder-text : "";
}
}