From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: The Gnus logo in the modeline is displayed with a non-transparent background
Date: Mon, 26 Feb 2018 12:18:38 -0800 [thread overview]
Message-ID: <87lgffqzc1.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87k1uzmsib.fsf@tullinup.koldfront.dk>
asjo@koldfront.dk (Adam Sjøgren) writes:
> Ah! Found the reason!
>
> When I got a "HiDPI" screen for the first time, Katsumi helped me with
> these two defadvice, to scale images:
>
> (defadvice create-image (after scale-image-size activate)
> "Scale the image size."
> (condition-case nil
> (let* ((magnitude (frame-parameter nil 'image-dpi-scale-magnitude))
> (image (copy-sequence ad-return-value))
> (size (image-size image t))
> (spec (cdr image))
> (image-width (or (plist-get spec :width) (car size)))
> (image-height (or (plist-get spec :height) (cdr size))))
> (plist-put spec :width (round (* image-width magnitude)))
> (plist-put spec :height (round (* image-height magnitude)))
> (plist-put spec :type 'imagemagick)
> (setq ad-return-value image))
> (error nil)))
>
> (defadvice find-image (after scale-image-size activate)
> "Scale the image size."
> (condition-case nil
> (let* ((magnitude (frame-parameter nil 'image-dpi-scale-magnitude))
> (image (copy-sequence ad-return-value))
> (size (image-size image t))
> (spec (cdr image))
> (image-width (or (plist-get spec :width) (car size)))
> (image-height (or (plist-get spec :height) (cdr size))))
> (plist-put spec :width (round (* image-width magnitude)))
> (plist-put spec :height (round (* image-height magnitude)))
> (plist-put spec :type 'imagemagick)
> (setq ad-return-value image))
> (error nil)))
>
> If I remove those (all images are too small, but) the image in the
> modeline is transparent!
Huh, now that you mention it, I see all the images are too small on my
(hdpi) monitor, too. Oh well, at least they're transparent!
I wonder if you could play with that `find-image' advice and make it
work. Isn't 'imagemagick an odd :type for the image found? I wonder if
that's necessary to make the re-scaling work correctly. What happens if
you hard-code it to 'xpm, just for this case?
Eric
next prev parent reply other threads:[~2018-02-26 20:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-25 21:31 Adam Sjøgren
2018-02-25 22:39 ` Andreas Schwab
2018-02-25 23:06 ` Adam Sjøgren
2018-02-26 0:02 ` Eric Abrahamsen
2018-02-26 19:59 ` Adam Sjøgren
2018-02-26 20:18 ` Eric Abrahamsen [this message]
2018-03-24 22:38 ` Adam Sjøgren
2018-03-29 8:12 ` Eric Abrahamsen
2018-03-29 11:49 ` Adam Sjøgren
2018-03-29 12:09 ` Robert Pluim
2018-03-29 12:31 ` Adam Sjøgren
2018-03-29 14:04 ` Robert Pluim
2018-03-29 14:17 ` Adam Sjøgren
2018-03-29 16:19 ` Robert Pluim
2018-03-29 16:43 ` Adam Sjøgren
2018-03-30 7:39 ` Robert Pluim
2018-02-26 19:22 ` Andreas Schwab
2018-02-26 19:31 ` Adam Sjøgren
2018-02-25 23:22 ` Mike Kupfer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lgffqzc1.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=ding@gnus.org \
/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.
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 NNTP newsgroup(s).