Working on history popup
parent
7e097aa713
commit
a31b59748d
basis/ui
gadgets/tables
tools/listener
|
@ -229,9 +229,13 @@ M: table model-changed
|
|||
[ >>mouse-index ] [ (select-row) ] bi
|
||||
] if ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
: row-action ( table -- )
|
||||
dup selected-row [ swap action>> call ] [ 2drop ] if ;
|
||||
|
||||
<PRIVATE
|
||||
|
||||
: table-button-up ( table -- )
|
||||
hand-click# get 2 =
|
||||
[ row-action ] [ update-selected-value ] if ;
|
||||
|
|
|
@ -485,6 +485,8 @@ M: completion-renderer row-value drop ;
|
|||
|
||||
completion-popup H{
|
||||
{ T{ key-down f f "ESC" } [ hide-completion-popup ] }
|
||||
{ T{ key-down f f "TAB" } [ table>> row-action ] }
|
||||
{ T{ key-down f f " " } [ table>> row-action ] }
|
||||
} set-gestures
|
||||
|
||||
: show-completion-popup ( interactor quot -- )
|
||||
|
@ -498,6 +500,10 @@ completion-popup H{
|
|||
[ vocabs-matching ] [ words-matching ] ?
|
||||
show-completion-popup ;
|
||||
|
||||
: history-completion-popup ( interactor -- )
|
||||
dup '[ _ history>> dup zip completions ]
|
||||
show-completion-popup ;
|
||||
|
||||
: pass-to-popup? ( gesture interactor -- ? )
|
||||
[ [ key-down? ] [ key-up? ] bi or ]
|
||||
[ completion-popup>> ]
|
||||
|
@ -512,4 +518,5 @@ M: interactor handle-gesture
|
|||
|
||||
interactor "completion" f {
|
||||
{ T{ key-down f f "TAB" } word-completion-popup }
|
||||
{ T{ key-down f { C+ } "p" } history-completion-popup }
|
||||
} define-command-map
|
Loading…
Reference in New Issue