diff options
| author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-10 14:52:00 +0200 | 
|---|---|---|
| committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-11 09:54:24 +0200 | 
| commit | a9e810c5e7344fb99b984e08c18f690c686a0d0b (patch) | |
| tree | 29a1f927f1ac802b59c31e846c9ed9e1c2353a44 | |
| parent | 6afc7b87d289265f464f9ad191c2245caf1a3223 (diff) | |
overlay for media
| -rw-r--r-- | lisp/mastodon-media.el | 33 | 
1 files changed, 19 insertions, 14 deletions
diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 1e4d8b1..541e6de 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -271,22 +271,27 @@ Replace them with the referenced image."              ;; proceed to load this image asynchronously              (put-text-property start end 'media-state 'loading)              (mastodon-media--load-image-from-url -             image-url media-type start (- end start)))))))) -            ;; (mastodon-media--moving-image-overlay start end))))))) +             image-url media-type start (- end start)) +            (mastodon-media--moving-image-overlay start end))))))) -;; (defun mastodon-media--moving-image-overlay (start end) -;;   "Add play symbol overlay to moving image media items." -;;   (let ((ov (make-overlay start end)) -;;         (type (get-text-property start 'mastodon-media-type))) -;;     (when (or (equal type "gifv") -;;               (equal type "video")) -;;       (overlay-put -;;        ov -;;        'after-string -;;        (propertize " " -;;                    'face -;;                    '((:height 1.5 :inherit 'font-lock-comment-face))))))) +;; (defvar-local mastodon-media--overlays nil +;;   "Holds a list of overlays in the buffer.") +(defun mastodon-media--moving-image-overlay (start end) +  "Add play symbol overlay to moving image media items." +  (let ((ov (make-overlay start end)) +        (type (get-text-property start 'mastodon-media-type))) +    (when (or (equal type "gifv") +              (equal type "video")) +      (overlay-put +       ov +       'after-string +       (propertize "" +                   'face +                   '((:height 3.5 :inherit 'font-lock-comment-face))))))) +;; (cl-pushnew ov mastodon-media--overlays))) + +(remove-overlays)  (defun mastodon-media--get-avatar-rendering (avatar-url)    "Return the string to be written that renders the avatar at AVATAR-URL."    ;; We use just an empty space as the textual representation.  | 
