Function: pdf-util-tooltip-arrow
pdf-util-tooltip-arrow is a natively compiled function defined in
pdf-util.el.
Signature
(pdf-util-tooltip-arrow IMAGE-TOP &optional TIMEOUT)
Source Code
;; Defined in /nix/store/63h5z2vmzn0mfavcxi2idi23g5xcgkbl-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-20260102.1101/pdf-util.el
(defun pdf-util-tooltip-arrow (image-top &optional timeout)
(pdf-util-assert-pdf-window)
(when (floatp image-top)
(setq image-top
(round (* image-top (cdr (pdf-view-image-size))))))
(let* ((x-gtk-use-system-tooltips nil)
;; ^ allow for display text property in tooltip
(dx (+ (or (car (window-margins)) 0)
(car (window-fringes))))
(dy image-top)
(pos (list dx dy dx (+ dy (* 2 (frame-char-height)))))
(vscroll
(pdf-util-required-vscroll pos))
(tooltip-frame-parameters
`((border-width . 0)
(internal-border-width . 0)
,@tooltip-frame-parameters))
(tooltip-hide-delay (or timeout 3)))
(when vscroll
(image-set-window-vscroll vscroll))
(setq dy (max 0 (- dy
(cdr (pdf-view-image-offset))
(window-vscroll nil t)
(frame-char-height))))
(let* ((e (window-inside-pixel-edges))
(xw (pdf-util-with-edges (e) e-width)))
(cl-incf dx (/ (- xw (car (pdf-view-image-size t))) 2)))
(pdf-util-tooltip-in-window
(propertize
" " 'display (propertize
"\u2192" ;;right arrow
'display '(height 2)
'face `(:foreground
"orange red"
:background
,(cond
((bound-and-true-p pdf-view-midnight-minor-mode)
(cdr pdf-view-midnight-colors))
((bound-and-true-p pdf-view-themed-minor-mode)
(face-background 'default nil))
(t "white")))))
dx dy)))