ui.tools.listener: support file-drop gesture
The array of dropped file names is pushed onto the listener's stack.factor-shell
parent
12d55bd882
commit
2ad605b9c7
|
@ -444,6 +444,11 @@ interactor "completion" f {
|
|||
|
||||
\ com-auto-use H{ { +nullary+ t } { +listener+ t } } define-command
|
||||
|
||||
: com-file-drop ( -- files )
|
||||
dropped-files get-global ;
|
||||
|
||||
\ com-file-drop H{ { +nullary+ t } { +listener+ t } } define-command
|
||||
|
||||
listener-gadget "toolbar" f {
|
||||
{ f restart-listener }
|
||||
{ T{ key-down f { A+ } "u" } com-auto-use }
|
||||
|
@ -472,6 +477,11 @@ listener-gadget "touchbar" f {
|
|||
{ f com-help }
|
||||
} define-command-map
|
||||
|
||||
listener-gadget "file-drop" "Files can be drag-and-dropped onto the listener."
|
||||
{
|
||||
{ T{ file-drop f f } com-file-drop }
|
||||
} define-command-map
|
||||
|
||||
M: listener-gadget graft*
|
||||
[ call-next-method ] [ restart-listener ] bi ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue