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)
`(progn
(with-busy (,root-widget)
(with-hourglass ,(list root-widget)
(gui:with-busy (,root-widget)
(gui:with-hourglass ,(list root-widget)
,@body))))
(defun password-dialog (parent title message &key (button-message "OK"))

View File

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