1
0
Fork 0

- [GUI] added visual hint that the process of inlining an image is in progress.

This commit is contained in:
cage 2023-05-13 12:13:58 +02:00
parent 6b12729128
commit b6bed17984
2 changed files with 21 additions and 19 deletions

View File

@ -93,8 +93,8 @@
(defmacro with-busy* ((root-widget) &body body) (defmacro with-busy* ((root-widget) &body body)
`(progn `(progn
(with-busy (,root-widget) (gui:with-busy (,root-widget)
(with-hourglass ,(list root-widget) (gui:with-hourglass ,(list root-widget)
,@body)))) ,@body))))
(defun password-dialog (parent title message &key (button-message "OK")) (defun password-dialog (parent title message &key (button-message "OK"))

View File

@ -407,23 +407,25 @@
:inline-image)) :inline-image))
(open-inline-callback () (open-inline-callback ()
(if (inline-possible-p link-value) (if (inline-possible-p link-value)
(let* ((file-path (slurp-iri main-window link-value)) (let ((file-path nil))
(image (gui:make-image file-path)) (gui-goodies:with-busy* (main-window)
(coordinates `(+ (:line ,line-count :char 0) 1 :lines))) (setf file-path (slurp-iri main-window link-value)))
(gui:insert-image (gemtext-widget main-window) image coordinates) (let ((image (gui:make-image file-path))
(with-accessors ((ir-lines ir-lines) (coordinates `(+ (:line ,line-count :char 0) 1 :lines)))
(ir-rendered-lines ir-rendered-lines)) main-window (gui:insert-image (gemtext-widget main-window) image coordinates)
(let* ((parent-line (elt ir-lines (- line-count 1))) (with-accessors ((ir-lines ir-lines)
(new-line (copy-list parent-line))) (ir-rendered-lines ir-rendered-lines)) main-window
(setf (getf new-line :type) (inline-type link-value)) (let* ((parent-line (elt ir-lines (- line-count 1)))
(setf ir-lines (new-line (copy-list parent-line)))
(fresh-vector-insert@ ir-lines (setf (getf new-line :type) (inline-type link-value))
new-line (setf ir-lines
line-count)) (fresh-vector-insert@ ir-lines
(setf ir-rendered-lines new-line
(fresh-vector-insert@ ir-lines line-count))
"" (setf ir-rendered-lines
line-count))))) (fresh-vector-insert@ ir-lines
""
line-count))))))
(funcall (link-click-mouse-1-callback-clsr link-value main-window))))) (funcall (link-click-mouse-1-callback-clsr link-value main-window)))))
(lambda () (lambda ()
(let* ((popup-menu (gui:make-menu nil (_"link menu"))) (let* ((popup-menu (gui:make-menu nil (_"link menu")))