emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using images in tabs


From: Lars Ingebrigtsen
Subject: Re: Using images in tabs
Date: Wed, 18 Sep 2019 15:43:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Juri Linkov <address@hidden> writes:

> Maybe xg_get_scale should be exposed to Lisp, then find-image
> could use it to choose a suitable image specification among e.g.
>
> etc/images/icons/hicolor/16x16/
> etc/images/icons/hicolor/24x24/
> etc/images/icons/hicolor/32x32/
> etc/images/icons/hicolor/48x48/
> etc/images/icons/hicolor/128x128/
> etc/images/icons/hicolor/scalable/
>
> Similar subdirs could be added to other images as well
> because this problem exists for other features, e.g. for
> subtree arrows in customization buffers, tool-bar icons, etc.

Yup.  Emacs currently auto-scales images using this very er ad-hoc method:

(defun image-compute-scaling-factor (scaling)
[...]
   ((eq scaling 'auto)
    (let ((width (/ (float (window-width nil t)) (window-width))))
      ;; If we assume that a typical character is 10 pixels in width,
      ;; then we should scale all images according to how wide they
      ;; are.  But don't scale images down.
      (if (< width 10)
          1
        (/ (float width) 10))))


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]