[Top][All Lists]

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

Re: Using images in tabs

From: Juri Linkov
Subject: Re: Using images in tabs
Date: Wed, 18 Sep 2019 23:50:29 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> 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)
> [...]

Meanwhile I tried to scale svg, and the result is not great.
Scaling up makes the image blurred, and scaling down makes the
image smeared.

PNG image

This is unexpected since svg is supposed to be scalable.

Another problem is that svg background is not transparent -
it takes the background color from the default face.
Like on the screenshot above, the unscaled image
in the buffer has the default brown background, and transparent
svg button on the grey tab-bar takes the same background.

PS: Tried out with this code:

  (defvar tab-bar-button-close
    (let ((svg (svg-create 33 33 :stroke-width 3 :stroke-color "black" 
:fill-color "none")))
      (svg-circle svg 16 16 12)
      (svg-line svg 10 10 22 22)
      (svg-line svg 10 22 22 10)
      (propertize "x"
                  'display (svg-image svg
                                      :max-width 9 :max-height 9
                                      :margin '(2 . 0)
                                      :ascent 'center)))
    "Button for closing the tab.")

reply via email to

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