Input Completion Improvements

clean-linux-x86-64
kusumotonorio 2019-08-10 22:02:17 +09:00
parent 41db42a571
commit bada736a3f
4 changed files with 22 additions and 16 deletions

View File

@ -15,8 +15,6 @@ ui.backend.cocoa.input-methods.editors io.encodings.utf16n
io.encodings.string classes.struct ;
IN: ui.backend.cocoa.views
SLOT: window
: send-mouse-moved ( view event -- )
[ mouse-location ] [ drop window ] 2bi
[ move-hand fire-motion yield ] [ drop ] if* ;
@ -364,10 +362,16 @@ PRIVATE>
METHOD: char validateUserInterfaceItem: id event
[
self window [
event -> action utf8 alien>string validate-action
[ >c-bool ] [ drop self event SUPER-> validateUserInterfaceItem: ] if
] [ 0 ] if*
self window :> window
window [
window world-focus :> gadget
gadget [
gadget preedit? not [
window event -> action utf8 alien>string validate-action
[ >c-bool ] [ drop self event SUPER-> validateUserInterfaceItem: ] if
] [ 0 ] if
] [ 0 ] if
] [ 0 ] if
] ;
METHOD: void undo: id event [ self event undo-action send-action$ ] ;
@ -481,9 +485,11 @@ PRIVATE>
] unless
gadget preedit? [
gadget [ remove-preedit-text ] [ remove-preedit-info ] bi
] when
str gadget user-input* drop
f gadget preedit-selection-mode?<<
str gadget user-input* drop
f gadget preedit-selection-mode?<<
] [
str window user-input
] if
] [
str window user-input
] if
@ -625,6 +631,8 @@ PRIVATE>
<CGRect>
] ;
METHOD: void doCommandBySelector: SEL selector [ ] ;
! Initialization
METHOD: void updateFactorGadgetSize: id notification
[
@ -634,8 +642,6 @@ PRIVATE>
] when
] ;
METHOD: void doCommandBySelector: SEL selector [ ] ;
METHOD: id initWithFrame: NSRect frame pixelFormat: id pixelFormat
[
self frame pixelFormat SUPER-> initWithFrame:pixelFormat:

View File

@ -22,7 +22,7 @@ TUPLE: editor < line-gadget
preedit-underlines ;
M: editor preedit? preedit-start>> [ t ] [ f ] if ;
<PRIVATE
: <loc> ( -- loc ) { 0 0 } <model> ;

View File

@ -401,6 +401,10 @@ M: f request-focus-on 2drop ;
: focus-path ( gadget -- seq )
[ focus>> ] follow ;
GENERIC: preedit? ( gadget -- ? )
M: gadget preedit? drop f ;
USE: vocabs.loader
{ "ui.gadgets" "prettyprint" } "ui.gadgets.prettyprint" require-when

View File

@ -63,10 +63,6 @@ M: propagate-key-gesture-tuple send-queued-gesture
[ gesture>> ] [ world>> world-focus ] bi
[ handle-gesture ] with each-parent drop ;
GENERIC: preedit? ( gadget -- ? )
M: gadget preedit? drop f ;
:: propagate-key-gesture ( gesture world -- )
world world-focus preedit? [
gesture world \ propagate-key-gesture-tuple queue-gesture