unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Emacs developers <emacs-devel@gnu.org>,
	Yuri Khan <yuri.v.khan@gmail.com>
Subject: Re: Using images in tabs
Date: Wed, 18 Sep 2019 23:50:29 +0300	[thread overview]
Message-ID: <871rwd5ouy.fsf@mail.linkov.net> (raw)
In-Reply-To: <87h859lny8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 18 Sep 2019 15:43:27 +0200")

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

>> 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.


[-- Attachment #2: close.png --]
[-- Type: image/png, Size: 5847 bytes --]

[-- Attachment #3: Type: text/plain, Size: 873 bytes --]


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	other threads:[~2019-09-18 20:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87tv9ir38c.fsf@mail.linkov.net>
     [not found] ` <83ftl11xdn.fsf@gnu.org>
2019-09-12 21:18   ` Using images in tabs (was: bug#37385: 27.0.50; Crash on multibyte assertion violation) Juri Linkov
2019-09-13  6:22     ` Eli Zaretskii
2019-09-15 20:57       ` Using images in tabs Juri Linkov
2019-09-16  4:15         ` Yuri Khan
2019-09-16  4:39           ` Eli Zaretskii
2019-09-16 20:51           ` Juri Linkov
2019-09-16 21:20             ` Lars Ingebrigtsen
2019-09-17 20:33               ` Juri Linkov
2019-09-18  6:44                 ` Robert Pluim
2019-09-18 13:43                 ` Lars Ingebrigtsen
2019-09-18 20:50                   ` Juri Linkov [this message]
2019-09-19 13:47                     ` Lars Ingebrigtsen
2019-09-20 18:44                       ` Alan Third
2019-09-16 22:49             ` Clément Pit-Claudel
2019-09-17  6:16               ` Eli Zaretskii
2019-09-17 20:35               ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rwd5ouy.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).