context menu for folders

This commit is contained in:
David Botton 2024-05-09 20:08:26 -04:00
parent 798ad3a201
commit 828a1a5fad
2 changed files with 17 additions and 1 deletions

View file

@ -107,6 +107,22 @@
(project-tree-dir-select obj (format nil "~A" item)))
:indent-level (1+ (indent-level node))
:visible nil
:on-context-menu
(lambda (obj)
(let* ((disp (text-value (content obj)))
(menu (create-panel obj
:left (left obj) :top (top obj)
:width (width obj)
:class *builder-window-desktop-class*))
(title (create-div menu :content disp))
(op (create-div menu :content "Toggle Open" :class *builder-menu-context-item-class*))
(opo (create-div menu :content "Open in OS" :class *builder-menu-context-item-class*)))
(declare (ignore title op))
(set-on-click opo (lambda (i)
(declare (ignore i))
(open-file-with-os item))
:cancel-event t)
(set-on-mouse-leave menu (lambda (obj) (destroy obj)))))
:content (first (last (pathname-directory item))))))
(dolist (item (sort (uiop:directory-files (directory-namestring dir))
(lambda (a b)

View file

@ -4,7 +4,7 @@
"Open a shell"
(let* ((*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*)
(win (create-gui-window obj :title (format nil "OS Shell - ~A - ~A"
(win (create-gui-window obj :title (format nil "OS Pseudo Shell - ~A - ~A"
(uiop:operating-system)
(uiop:hostname))
:top 40 :left 225