mirror of https://codeberg.org/cage/tinmop/
- [GUI] fixed inlining bitmap position.
This commit is contained in:
parent
097389e0b3
commit
917ca507ab
|
@ -366,7 +366,7 @@
|
||||||
((gemini-client:header-success-p status-code)
|
((gemini-client:header-success-p status-code)
|
||||||
(slurp-non-text-data main-window iri :try-to-open nil))))))
|
(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 ()
|
(labels ((add-to-tour-callback ()
|
||||||
(ev:with-enqueued-process-and-unblock ()
|
(ev:with-enqueued-process-and-unblock ()
|
||||||
(comm:make-request :tour-add-link
|
(comm:make-request :tour-add-link
|
||||||
|
@ -398,19 +398,18 @@
|
||||||
(re:scan "(?i)gif$" link-value)
|
(re:scan "(?i)gif$" link-value)
|
||||||
(re:scan "(?i)bmp$" link-value)
|
(re:scan "(?i)bmp$" link-value)
|
||||||
(re:scan "(?i)tga$" link-value)))
|
(re:scan "(?i)tga$" link-value)))
|
||||||
(open-inline-clsr (x y)
|
(open-inline-callback ()
|
||||||
(lambda ()
|
(if (inline-possible-p)
|
||||||
(if (inline-possible-p)
|
(let* ((file-path (slurp-iri main-window link-value))
|
||||||
(let* ((file-path (slurp-iri main-window link-value))
|
(image (gui:make-image file-path))
|
||||||
(image (gui:make-image file-path))
|
(coordinates `(+ (:line ,line-count :char 0) 1 :lines)))
|
||||||
(coordinates `(+ (:x ,x :y ,y) 1 :lines)))
|
(gui:insert-image (gemtext-widget main-window) image coordinates))
|
||||||
(gui:insert-image (gemtext-widget main-window) image coordinates))
|
(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")))
|
||||||
(x (gui:screen-mouse-x))
|
(x (gui:screen-mouse-x))
|
||||||
(y (gui:screen-mouse-y)))
|
(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 bookmarks") #'bookmark-link-callback)
|
||||||
(gui:make-menubutton popup-menu (_ "Add link to tour") #'add-to-tour-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)
|
(gui:make-menubutton popup-menu (_ "Copy link to the clipboard") #'copy-link-callback)
|
||||||
|
@ -509,7 +508,8 @@
|
||||||
:button-3-callback
|
:button-3-callback
|
||||||
(contextual-menu-link-clrs link-name
|
(contextual-menu-link-clrs link-name
|
||||||
target-iri
|
target-iri
|
||||||
main-window)
|
main-window
|
||||||
|
line-number)
|
||||||
:over-callback
|
:over-callback
|
||||||
(lambda () (print-info-message target-iri))
|
(lambda () (print-info-message target-iri))
|
||||||
:leave-callback
|
:leave-callback
|
||||||
|
|
Loading…
Reference in New Issue