ui.tools.listener: support file-drop gesture

The array of dropped file names is pushed onto the listener's stack.
factor-shell
Alexander Iljin 2017-08-24 04:26:47 +03:00 committed by John Benediktsson
parent 12d55bd882
commit 2ad605b9c7
1 changed files with 10 additions and 0 deletions

View File

@ -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 ;