1
0
Fork 0

- [GUI] fixed inlining bitmap position.

This commit is contained in:
cage 2023-05-12 15:32:54 +02:00
parent 097389e0b3
commit 917ca507ab
1 changed files with 11 additions and 11 deletions

View File

@ -366,7 +366,7 @@
((gemini-client:header-success-p status-code)
(slurp-non-text-data main-window iri :try-to-open nil))))))
(defun contextual-menu-link-clrs (link-name link-value main-window)
(defun contextual-menu-link-clrs (link-name link-value main-window line-count)
(labels ((add-to-tour-callback ()
(ev:with-enqueued-process-and-unblock ()
(comm:make-request :tour-add-link
@ -398,19 +398,18 @@
(re:scan "(?i)gif$" link-value)
(re:scan "(?i)bmp$" link-value)
(re:scan "(?i)tga$" link-value)))
(open-inline-clsr (x y)
(lambda ()
(if (inline-possible-p)
(let* ((file-path (slurp-iri main-window link-value))
(image (gui:make-image file-path))
(coordinates `(+ (:x ,x :y ,y) 1 :lines)))
(gui:insert-image (gemtext-widget main-window) image coordinates))
(funcall (link-click-mouse-1-callback-clsr link-value main-window))))))
(open-inline-callback ()
(if (inline-possible-p)
(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))
(funcall (link-click-mouse-1-callback-clsr link-value main-window)))))
(lambda ()
(let* ((popup-menu (gui:make-menu nil (_"link menu")))
(x (gui:screen-mouse-x))
(y (gui:screen-mouse-y)))
(gui:make-menubutton popup-menu (_ "Inline") (open-inline-clsr x y))
(gui:make-menubutton popup-menu (_ "Inline") #'open-inline-callback)
(gui:make-menubutton popup-menu (_ "Add link to bookmarks") #'bookmark-link-callback)
(gui:make-menubutton popup-menu (_ "Add link to tour") #'add-to-tour-callback)
(gui:make-menubutton popup-menu (_ "Copy link to the clipboard") #'copy-link-callback)
@ -509,7 +508,8 @@
:button-3-callback
(contextual-menu-link-clrs link-name
target-iri
main-window)
main-window
line-number)
:over-callback
(lambda () (print-info-message target-iri))
:leave-callback