mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
widget,io,app: draw IME composition underline
Track IME composition range updates as key.CompositionEvent and route them to the focused editor. Draw a thin underline under the current composition range using the editor text material. Keep the composition range in imeState so it is reset with the rest of the editor input method state, and normalize it in input.Router before forwarding CompositionEvent. Signed-off-by: qiannian <qianniancn@gmail.com>
This commit is contained in:
+9
-5
@@ -77,6 +77,9 @@ type Caret struct {
|
||||
// SelectionEvent is generated when an input method changes the selection.
|
||||
type SelectionEvent Range
|
||||
|
||||
// CompositionEvent is generated when an input method changes the composing range.
|
||||
type CompositionEvent Range
|
||||
|
||||
// SnippetEvent is generated when the snippet range is updated by an
|
||||
// input method.
|
||||
type SnippetEvent Range
|
||||
@@ -243,11 +246,12 @@ func (h InputHintOp) Add(o *op.Ops) {
|
||||
data[1] = byte(h.Hint)
|
||||
}
|
||||
|
||||
func (EditEvent) ImplementsEvent() {}
|
||||
func (Event) ImplementsEvent() {}
|
||||
func (FocusEvent) ImplementsEvent() {}
|
||||
func (SnippetEvent) ImplementsEvent() {}
|
||||
func (SelectionEvent) ImplementsEvent() {}
|
||||
func (EditEvent) ImplementsEvent() {}
|
||||
func (Event) ImplementsEvent() {}
|
||||
func (FocusEvent) ImplementsEvent() {}
|
||||
func (CompositionEvent) ImplementsEvent() {}
|
||||
func (SnippetEvent) ImplementsEvent() {}
|
||||
func (SelectionEvent) ImplementsEvent() {}
|
||||
|
||||
func (FocusCmd) ImplementsCommand() {}
|
||||
func (SoftKeyboardCmd) ImplementsCommand() {}
|
||||
|
||||
Reference in New Issue
Block a user