unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Add Tango and Adwaita icons for the toolbar
       [not found] <EDDF7D6A-E818-483A-AA98-CB2D093BCDAC@gmail.com>
@ 2024-05-04  9:48 ` Po Lu
  2024-05-04 16:42   ` Yuan Fu
  2024-05-04 12:27 ` Eli Zaretskii
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 44+ messages in thread
From: Po Lu @ 2024-05-04  9:48 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Ergus via Emacs development discussions.

Yuan Fu <casouri@gmail.com> writes:

> Hey guys,
>
> I followed the original tool-bar icon thread in 2022. At the time I
> didn’t have much time and I personally prefer colorful icons for the
> tool bar [1] (IMO mono-colored symbolic icons are more suitable for
> inline, small icons), so I didn’t do anything except for observing the
> discussion.
>
> [1] I especially adore the life ring icon for help! Whatever icon set
> we use for the tool-bar, the help icon should always be a cute life
> ring :-)
>
> The recent Emacs app icon thread reminded me of that thread, and I do
> have time now. So, I went ahead and searched for the Tango and Adwaita
> icons (basically the high-res version of the existing tool-bar icon
> that we use), then converted them to be suitable for Emacs tool-bar.
>
> About 1/3 of the icons can be directly taken from Tango or Adwaita,
> the rest I have to modify or kind of take apart and
> re-assemble. Anyway, in the end I managed to get most of the basic
> icons covered. For details see etc/images/scalable/README.
>
> You can see the attached screenshots for the current built-in icons
> and the new icons. I also attached the patch for it. You want to
> rebuild or byte-compile tool-bar.el for the new icons to take effect.
>
> I hope these new icons won’t be controversial. As you can see, they
> are basically straight high-res upgrades for the existing icons. There
> are many imperfections that’ll be atrocious in the eyes of a graphic
> designer—I did the conversion work in an afternoon and I’m no where
> near a graphic designer; but it’s definitely an upgrade and we can
> always incrementally improve after.

They will not be controversial if it is possible to opt out of them, and
enough of the icons are replaced that none of us encounter tool-bars
bearing an unsightly mixture of old and new.  That is to say:

Please generate XPM and monochrome PBM versions of the new icons
introduced, these being the only two image formats implemented without
dependencies in image.c, and enable SVG only on systems where the
scalable versions produce a visible improvement to image quality.
Finally, please see that _all_ major modes are covered by this new icon
set, including but not limited to message-mode, Doc View,
xwidget-webkit, and anywhere else a custom tool-bar-map is defined, and
that there is means of reverting to the old set of icons, for users who
are so inclined.

The PBM icons should not be unmodified ImageMagick output, they should
be modified for legibility on actual monochrome displays.  The other day
there was a post to help-gnu-emacs from an Android user with a
monochrome display, so these configurations are by no means irrelevant.

> If no one objects, I’ll happily push this to master.

Nobody objects to these icons in principle, but do not push such changes
until they are complete and have been tested by an adequately wide
audience.  Let it not be forgotten that we are still contending with the
fallout from another enormously premature change.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
       [not found] <EDDF7D6A-E818-483A-AA98-CB2D093BCDAC@gmail.com>
  2024-05-04  9:48 ` Add Tango and Adwaita icons for the toolbar Po Lu
@ 2024-05-04 12:27 ` Eli Zaretskii
  2024-05-04 21:27   ` Yuan Fu
  2024-05-05 15:25 ` Dmitry Gutov
  2024-05-05 23:01 ` Rudolf Adamkovič
  3 siblings, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2024-05-04 12:27 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 4 May 2024 02:20:07 -0700
> 
> You can see the attached screenshots for the current built-in icons and the new icons. I also attached the patch for it. You want to rebuild or byte-compile tool-bar.el for the new icons to take effect.

Thanks, but are the new icons of the same size?  If not, there could
be tool-bar size problems.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-04  9:48 ` Add Tango and Adwaita icons for the toolbar Po Lu
@ 2024-05-04 16:42   ` Yuan Fu
  2024-05-05  0:22     ` Po Lu
  0 siblings, 1 reply; 44+ messages in thread
From: Yuan Fu @ 2024-05-04 16:42 UTC (permalink / raw)
  To: Po Lu; +Cc: Ergus via Emacs development discussions., Stefan Kangas



> On May 4, 2024, at 2:48 AM, Po Lu <luangruo@yahoo.com> wrote:
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
>> Hey guys,
>> 
>> I followed the original tool-bar icon thread in 2022. At the time I
>> didn’t have much time and I personally prefer colorful icons for the
>> tool bar [1] (IMO mono-colored symbolic icons are more suitable for
>> inline, small icons), so I didn’t do anything except for observing the
>> discussion.
>> 
>> [1] I especially adore the life ring icon for help! Whatever icon set
>> we use for the tool-bar, the help icon should always be a cute life
>> ring :-)
>> 
>> The recent Emacs app icon thread reminded me of that thread, and I do
>> have time now. So, I went ahead and searched for the Tango and Adwaita
>> icons (basically the high-res version of the existing tool-bar icon
>> that we use), then converted them to be suitable for Emacs tool-bar.
>> 
>> About 1/3 of the icons can be directly taken from Tango or Adwaita,
>> the rest I have to modify or kind of take apart and
>> re-assemble. Anyway, in the end I managed to get most of the basic
>> icons covered. For details see etc/images/scalable/README.
>> 
>> You can see the attached screenshots for the current built-in icons
>> and the new icons. I also attached the patch for it. You want to
>> rebuild or byte-compile tool-bar.el for the new icons to take effect.
>> 
>> I hope these new icons won’t be controversial. As you can see, they
>> are basically straight high-res upgrades for the existing icons. There
>> are many imperfections that’ll be atrocious in the eyes of a graphic
>> designer—I did the conversion work in an afternoon and I’m no where
>> near a graphic designer; but it’s definitely an upgrade and we can
>> always incrementally improve after.
> 
> They will not be controversial if it is possible to opt out of them, and
> enough of the icons are replaced that none of us encounter tool-bars
> bearing an unsightly mixture of old and new.  That is to say:
> 
> Please generate XPM and monochrome PBM versions of the new icons
> introduced, these being the only two image formats implemented without
> dependencies in image.c, and enable SVG only on systems where the
> scalable versions produce a visible improvement to image quality.
> Finally, please see that _all_ major modes are covered by this new icon
> set, including but not limited to message-mode, Doc View,
> xwidget-webkit, and anywhere else a custom tool-bar-map is defined, and
> that there is means of reverting to the old set of icons, for users who
> are so inclined.

I don’t think it’s necessary to generate XPM and BPM versions, because if you compare the new icons with the old, you’ll find that they are essentially the same icon (same shape, motif, etc). That is to say, we already have XPM and BPM version of the icons: the current ones.

Also the icons are in png format, the source is svg, but I exported the svg into png. Because svg isn’t rendered very well, presumably because theses icons are relatively complicated? (More complicated than the symbolic icons for sure.)

As for opting-out, there isn’t a mechanism to explicitly choose what version of icons to use in tool-bar.el right now. So it’ll need to be added. I believe the branch mentioned in the original discussion, created by Stefan K, has some mechanism for an “icon theme”. Maybe we can merge that, plus the new monotone icons in that branch, but left out changing the tool-bar icons?

It’ll be a big project to find counterparts for all the current icons, plus I’m not a designer so I can’t conjure up icons by myself :-) I think we could make it opt-in first, and make it default when we have full coverage.

> The PBM icons should not be unmodified ImageMagick output, they should
> be modified for legibility on actual monochrome displays.  The other day
> there was a post to help-gnu-emacs from an Android user with a
> monochrome display, so these configurations are by no means irrelevant.
> 
>> If no one objects, I’ll happily push this to master.
> 
> Nobody objects to these icons in principle, but do not push such changes
> until they are complete and have been tested by an adequately wide
> audience.  Let it not be forgotten that we are still contending with the
> fallout from another enormously premature change.

Yuan


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-04 12:27 ` Eli Zaretskii
@ 2024-05-04 21:27   ` Yuan Fu
  2024-05-05  0:08     ` Po Lu
  2024-05-05  5:33     ` Eli Zaretskii
  0 siblings, 2 replies; 44+ messages in thread
From: Yuan Fu @ 2024-05-04 21:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel



> On May 4, 2024, at 5:27 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Sat, 4 May 2024 02:20:07 -0700
>> 
>> You can see the attached screenshots for the current built-in icons and the new icons. I also attached the patch for it. You want to rebuild or byte-compile tool-bar.el for the new icons to take effect.
> 
> Thanks, but are the new icons of the same size?  If not, there could
> be tool-bar size problems.

They’re not the same size. The new icons are 64x64. It works fine on my machine, but I don’t know about on Linux. I'll test it on my Linux machine, but how do you make Emacs use the built-in icons instead of system icons on Linux?

Yuan


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-04 21:27   ` Yuan Fu
@ 2024-05-05  0:08     ` Po Lu
  2024-05-05 15:42       ` Dmitry Gutov
  2024-05-05  5:33     ` Eli Zaretskii
  1 sibling, 1 reply; 44+ messages in thread
From: Po Lu @ 2024-05-05  0:08 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Eli Zaretskii, emacs-devel

Yuan Fu <casouri@gmail.com> writes:

> They’re not the same size. The new icons are 64x64. It works fine on
> my machine, but I don’t know about on Linux. I'll test it on my Linux
> machine, but how do you make Emacs use the built-in icons instead of
> system icons on Linux?

In this instance, building Emacs --with-x-toolkit=no.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-04 16:42   ` Yuan Fu
@ 2024-05-05  0:22     ` Po Lu
  2024-05-05  3:04       ` Yuan Fu
  2024-05-05  5:55       ` Eli Zaretskii
  0 siblings, 2 replies; 44+ messages in thread
From: Po Lu @ 2024-05-05  0:22 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

Yuan Fu <casouri@gmail.com> writes:

> I don’t think it’s necessary to generate XPM and BPM versions, because
> if you compare the new icons with the old, you’ll find that they are
> essentially the same icon (same shape, motif, etc). That is to say, we
> already have XPM and BPM version of the icons: the current ones.

The sizes and designs of the new icons are different from the originals,
and I will not stand for having even the _tool-bar_ icons be inferior
when this or that optional dependency is not available.  Moreover, XPM
icons are better efficiency-wise on X, all the more so when the display
is on the other end of a wide-area network connection.

> Also the icons are in png format, the source is svg, but I exported
> the svg into png. Because svg isn’t rendered very well, presumably
> because theses icons are relatively complicated? (More complicated
> than the symbolic icons for sure.)

If the display of the SVGs is inadequate, they would better be removed
completely.

> As for opting-out, there isn’t a mechanism to explicitly choose what
> version of icons to use in tool-bar.el right now. So it’ll need to be
> added. I believe the branch mentioned in the original discussion,
> created by Stefan K, has some mechanism for an “icon theme”. Maybe we
> can merge that, plus the new monotone icons in that branch, but left
> out changing the tool-bar icons?
>
> It’ll be a big project to find counterparts for all the current icons,
> plus I’m not a designer so I can’t conjure up icons by myself :-) I
> think we could make it opt-in first, and make it default when we have
> full coverage.

Whatever you decide, please don't merge it into master until it is
ready.  I suggest reusing the sctatch/icons branch for the time being.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  0:22     ` Po Lu
@ 2024-05-05  3:04       ` Yuan Fu
  2024-05-05  4:14         ` Po Lu
  2024-05-05  6:01         ` Eli Zaretskii
  2024-05-05  5:55       ` Eli Zaretskii
  1 sibling, 2 replies; 44+ messages in thread
From: Yuan Fu @ 2024-05-05  3:04 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel



> On May 4, 2024, at 5:22 PM, Po Lu <luangruo@yahoo.com> wrote:
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
>> I don’t think it’s necessary to generate XPM and BPM versions, because
>> if you compare the new icons with the old, you’ll find that they are
>> essentially the same icon (same shape, motif, etc). That is to say, we
>> already have XPM and BPM version of the icons: the current ones.
> 
> The sizes and designs of the new icons are different from the originals,
> and I will not stand for having even the _tool-bar_ icons be inferior
> when this or that optional dependency is not available.  Moreover, XPM
> icons are better efficiency-wise on X, all the more so when the display
> is on the other end of a wide-area network connection.

I don’t understand, don’t you like the current icons better? Why are they inferior now? I certainly would like to have xpm and bpm versions for the new icons, but as I said, I’m no graphic designer and have no ability to hand-draw them; the only thing I can do is to convert them from png, which you also against. (Though, to be fair, even if I have the ability, I probably wouldn’t want to, it’s a lot of work to hand draw all these icons.)

> 
>> Also the icons are in png format, the source is svg, but I exported
>> the svg into png. Because svg isn’t rendered very well, presumably
>> because theses icons are relatively complicated? (More complicated
>> than the symbolic icons for sure.)
> 
> If the display of the SVGs is inadequate, they would better be removed
> completely.

They are the “source file” of the png icons. And I didn’t just take these svg from else where, I had to make many modifications to them. If we want to later export png files with different sizes, or tweak the icons, we need these svgs.

> 
>> As for opting-out, there isn’t a mechanism to explicitly choose what
>> version of icons to use in tool-bar.el right now. So it’ll need to be
>> added. I believe the branch mentioned in the original discussion,
>> created by Stefan K, has some mechanism for an “icon theme”. Maybe we
>> can merge that, plus the new monotone icons in that branch, but left
>> out changing the tool-bar icons?
>> 
>> It’ll be a big project to find counterparts for all the current icons,
>> plus I’m not a designer so I can’t conjure up icons by myself :-) I
>> think we could make it opt-in first, and make it default when we have
>> full coverage.
> 
> Whatever you decide, please don't merge it into master until it is
> ready.  I suggest reusing the sctatch/icons branch for the time being.

I’m not going to merge it before discussion settled.

Yuan


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
@ 2024-05-05  4:07 Elijah G
       [not found] ` <15F31342-2F2E-4F1E-9FE2-D8F1A62BCC5A@gmail.com>
  0 siblings, 1 reply; 44+ messages in thread
From: Elijah G @ 2024-05-05  4:07 UTC (permalink / raw)
  To: casouri; +Cc: emacs-devel, Po Lu

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

Yuan Fu <casouri@gmail.com> writes:
> I certainly would like to have xpm and bpm versions for the new
> icons, but as I said, I’m no graphic designer and have no ability to
hand-draw
> them; the only thing I can do is to convert them from png, which you also
> against. (Though, to be fair, even if I have the
> ability, I probably wouldn’t want to, it’s a lot of work to hand draw all
these icons.)

Hi, I'm interested in help to convert the icons into xpm and bpm, i think
the process would be faster if the original icons are in svg otherwise i
can make my best effort in help.

[-- Attachment #2: Type: text/html, Size: 849 bytes --]

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  3:04       ` Yuan Fu
@ 2024-05-05  4:14         ` Po Lu
  2024-05-05  6:59           ` Yuan Fu
  2024-05-05  6:01         ` Eli Zaretskii
  1 sibling, 1 reply; 44+ messages in thread
From: Po Lu @ 2024-05-05  4:14 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

Yuan Fu <casouri@gmail.com> writes:

> I don’t understand, don’t you like the current icons better?

I never said I did.

> Why are they inferior now?

Simply put, because some users might express a preference for these new
icons.

> I certainly would like to have xpm and bpm versions for the new icons,
> but as I said, I’m no graphic designer and have no ability to
> hand-draw them; the only thing I can do is to convert them from png,
> which you also against. (Though, to be fair, even if I have the
> ability, I probably wouldn’t want to, it’s a lot of work to hand draw
> all these icons.)

It's fine to use converted XPM images as-is, but the results of
conversions to PBM should be edited so that the outlines of the
originals remain well-defined, which shouldn't be prohibitively
difficult even for amateurs, speaking from experience.

> They are the “source file” of the png icons. And I didn’t just take
> these svg from else where, I had to make many modifications to
> them. If we want to later export png files with different sizes, or
> tweak the icons, we need these svgs.

Please move them to a separate folder or somewhere they will not be
confused with the icons that are in fact loaded.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-04 21:27   ` Yuan Fu
  2024-05-05  0:08     ` Po Lu
@ 2024-05-05  5:33     ` Eli Zaretskii
  2024-05-05  6:41       ` Po Lu
  1 sibling, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2024-05-05  5:33 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 4 May 2024 14:27:42 -0700
> Cc: emacs-devel@gnu.org
> 
> > Thanks, but are the new icons of the same size?  If not, there could
> > be tool-bar size problems.
> 
> They’re not the same size. The new icons are 64x64. It works fine on my machine, but I don’t know about on Linux. I'll test it on my Linux machine, but how do you make Emacs use the built-in icons instead of system icons on Linux?

What do you mean by "works fine"?  Does the tool bar resize to
accommodate the larger icons?  If not, what happens?

Can you make the tarball of the icons available for download
somewhere, so that people could try them and report any problems?

Thanks.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  0:22     ` Po Lu
  2024-05-05  3:04       ` Yuan Fu
@ 2024-05-05  5:55       ` Eli Zaretskii
  1 sibling, 0 replies; 44+ messages in thread
From: Eli Zaretskii @ 2024-05-05  5:55 UTC (permalink / raw)
  To: Po Lu; +Cc: casouri, emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Sun, 05 May 2024 08:22:08 +0800
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
> > I don’t think it’s necessary to generate XPM and BPM versions, because
> > if you compare the new icons with the old, you’ll find that they are
> > essentially the same icon (same shape, motif, etc). That is to say, we
> > already have XPM and BPM version of the icons: the current ones.

But aren't the new icons in the XPM format nicer-looking?  If so, it
still makes sense to prepare them in thee two formats, because Emacs
can display them in its bare-bones build with no optional libraries.

> The sizes and designs of the new icons are different from the originals,
> and I will not stand for having even the _tool-bar_ icons be inferior
> when this or that optional dependency is not available.  Moreover, XPM
> icons are better efficiency-wise on X, all the more so when the display
> is on the other end of a wide-area network connection.

I agree, new icons should be available in those two formats.

> > Also the icons are in png format, the source is svg, but I exported
> > the svg into png. Because svg isn’t rendered very well, presumably
> > because theses icons are relatively complicated? (More complicated
> > than the symbolic icons for sure.)
> 
> If the display of the SVGs is inadequate, they would better be removed
> completely.

I'm not sure.  We should collect user experience and perhaps make SVG
be not the first priority, but there's no need to remove them
completely, as someone might like them and/or have a librsvg
implementation that doesn't have this problem.

> > As for opting-out, there isn’t a mechanism to explicitly choose what
> > version of icons to use in tool-bar.el right now. So it’ll need to be
> > added. I believe the branch mentioned in the original discussion,
> > created by Stefan K, has some mechanism for an “icon theme”. Maybe we
> > can merge that, plus the new monotone icons in that branch, but left
> > out changing the tool-bar icons?
> >
> > It’ll be a big project to find counterparts for all the current icons,
> > plus I’m not a designer so I can’t conjure up icons by myself :-) I
> > think we could make it opt-in first, and make it default when we have
> > full coverage.

We don't have to come up with counterparts for all the icons, provided
that they could be mixed without cause unpleasant results.

> Whatever you decide, please don't merge it into master until it is
> ready.  I suggest reusing the sctatch/icons branch for the time being.

Agreed.  A branch is also preferable for preserving the results of
this work, even if we decide for now not to land it.

Thanks.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  3:04       ` Yuan Fu
  2024-05-05  4:14         ` Po Lu
@ 2024-05-05  6:01         ` Eli Zaretskii
  2024-05-05  6:39           ` Po Lu
  1 sibling, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2024-05-05  6:01 UTC (permalink / raw)
  To: Yuan Fu; +Cc: luangruo, emacs-devel

> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 4 May 2024 20:04:35 -0700
> Cc: emacs-devel@gnu.org
> 
> I don’t understand, don’t you like the current icons better? Why are they inferior now? I certainly would like to have xpm and bpm versions for the new icons, but as I said, I’m no graphic designer and have no ability to hand-draw them; the only thing I can do is to convert them from png, which you also against. (Though, to be fair, even if I have the ability, I probably wouldn’t want to, it’s a lot of work to hand draw all these icons.)

What are the problems with converting to XPM and PBM from one of the
existing formats (PNG or SVG, AFAIU)?  Why do they have to be hand-drawn?



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  6:01         ` Eli Zaretskii
@ 2024-05-05  6:39           ` Po Lu
  0 siblings, 0 replies; 44+ messages in thread
From: Po Lu @ 2024-05-05  6:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Yuan Fu, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> What are the problems with converting to XPM and PBM from one of the
> existing formats (PNG or SVG, AFAIU)?  Why do they have to be hand-drawn?

XPM icons don't need manual adjustments after conversion, whereas PBM
icons are monochrome bitmaps, which conversion programs generate poorly.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  5:33     ` Eli Zaretskii
@ 2024-05-05  6:41       ` Po Lu
  2024-05-05  7:03         ` Yuan Fu
  2024-05-05 17:06         ` Max Nikulin
  0 siblings, 2 replies; 44+ messages in thread
From: Po Lu @ 2024-05-05  6:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Yuan Fu, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> What do you mean by "works fine"?  Does the tool bar resize to
> accommodate the larger icons?  If not, what happens?

The NS and GTK toolbars resize icons to fit in themselves, and as such
their users are not in a position to notice problems arising from
inconsistently proportioned (or oversized) tool-bar icons.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  4:14         ` Po Lu
@ 2024-05-05  6:59           ` Yuan Fu
  0 siblings, 0 replies; 44+ messages in thread
From: Yuan Fu @ 2024-05-05  6:59 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel



> On May 4, 2024, at 9:14 PM, Po Lu <luangruo@yahoo.com> wrote:
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
>> I don’t understand, don’t you like the current icons better?
> 
> I never said I did.
> 
>> Why are they inferior now?
> 
> Simply put, because some users might express a preference for these new
> icons.
> 
>> I certainly would like to have xpm and bpm versions for the new icons,
>> but as I said, I’m no graphic designer and have no ability to
>> hand-draw them; the only thing I can do is to convert them from png,
>> which you also against. (Though, to be fair, even if I have the
>> ability, I probably wouldn’t want to, it’s a lot of work to hand draw
>> all these icons.)
> 
> It's fine to use converted XPM images as-is, but the results of
> conversions to PBM should be edited so that the outlines of the
> originals remain well-defined, which shouldn't be prohibitively
> difficult even for amateurs, speaking from experience.

We now have Elijah for help, so that shouldn’t be an issue anymore.

> 
>> They are the “source file” of the png icons. And I didn’t just take
>> these svg from else where, I had to make many modifications to
>> them. If we want to later export png files with different sizes, or
>> tweak the icons, we need these svgs.
> 
> Please move them to a separate folder or somewhere they will not be
> confused with the icons that are in fact loaded.

Sure. Any suggestions?

Yuan




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  6:41       ` Po Lu
@ 2024-05-05  7:03         ` Yuan Fu
  2024-05-05  8:04           ` Po Lu
  2024-05-05  9:10           ` Eli Zaretskii
  2024-05-05 17:06         ` Max Nikulin
  1 sibling, 2 replies; 44+ messages in thread
From: Yuan Fu @ 2024-05-05  7:03 UTC (permalink / raw)
  To: Po Lu; +Cc: Eli Zaretskii, emacs-devel



> On May 4, 2024, at 11:41 PM, Po Lu <luangruo@yahoo.com> wrote:
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
>> What do you mean by "works fine"?  Does the tool bar resize to
>> accommodate the larger icons?  If not, what happens?
> 
> The NS and GTK toolbars resize icons to fit in themselves, and as such
> their users are not in a position to notice problems arising from
> inconsistently proportioned (or oversized) tool-bar icons.

And we actually want the icons to be “oversized” so they still look crisp on high-res displays.

Yuan


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
       [not found] ` <15F31342-2F2E-4F1E-9FE2-D8F1A62BCC5A@gmail.com>
@ 2024-05-05  7:06   ` Yuan Fu
  2024-05-05  8:07   ` Po Lu
  2024-05-06  5:10   ` Elijah G
  2 siblings, 0 replies; 44+ messages in thread
From: Yuan Fu @ 2024-05-05  7:06 UTC (permalink / raw)
  To: Elijah G; +Cc: emacs-devel, Po Lu



> On May 4, 2024, at 11:57 PM, Yuan Fu <casouri@gmail.com> wrote:
> 
> 
> 
>> On May 4, 2024, at 9:07 PM, Elijah G <eg642616@gmail.com> wrote:
>> 
>> Yuan Fu <casouri@gmail.com> writes:
>>> I certainly would like to have xpm and bpm versions for the new
>>> icons, but as I said, I’m no graphic designer and have no ability to hand-draw 
>>> them; the only thing I can do is to convert them from png, which you also
>>> against. (Though, to be fair, even if I have the
>>> ability, I probably wouldn’t want to, it’s a lot of work to hand draw all these icons.)
>> 
>> Hi, I'm interested in help to convert the icons into xpm and bpm, i think the process would be faster if the original icons are in svg otherwise i can make my best effort in help.
> 
> That’s great news! You can find the svg icons I made in etc/images/scalable in the scratch/tango-icons branch. You can get that branch by
> 
> git clone -b scratch/tango-icons git://git.sv.gnu.org/emacs.git

And before anyone comments on the commit messages on that branch: I’ll squash and write proper commit messages later.

Yuan


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  7:03         ` Yuan Fu
@ 2024-05-05  8:04           ` Po Lu
  2024-05-05  9:10           ` Eli Zaretskii
  1 sibling, 0 replies; 44+ messages in thread
From: Po Lu @ 2024-05-05  8:04 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Eli Zaretskii, emacs-devel

Yuan Fu <casouri@gmail.com> writes:

> And we actually want the icons to be “oversized” so they still look
> crisp on high-res displays.

This isn't possible on all Emacs configurations: the most bare-bones X
and W32 builds do not support resizing toolbar icons nor image
transforms at all.  The correct approach is to distribute multiple
versions of these icons that run the entire gamut of display densities.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
       [not found] ` <15F31342-2F2E-4F1E-9FE2-D8F1A62BCC5A@gmail.com>
  2024-05-05  7:06   ` Yuan Fu
@ 2024-05-05  8:07   ` Po Lu
  2024-05-06  0:10     ` Yuan Fu
  2024-05-06  5:10   ` Elijah G
  2 siblings, 1 reply; 44+ messages in thread
From: Po Lu @ 2024-05-05  8:07 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Elijah G, emacs-devel

Yuan Fu <casouri@gmail.com> writes:

>> On May 4, 2024, at 9:07 PM, Elijah G <eg642616@gmail.com> wrote:
>> 
>> Yuan Fu <casouri@gmail.com> writes:
>> > I certainly would like to have xpm and bpm versions for the new
>> > icons, but as I said, I’m no graphic designer and have no ability to hand-draw 
>> > them; the only thing I can do is to convert them from png, which you also
>> > against. (Though, to be fair, even if I have the
>> > ability, I probably wouldn’t want to, it’s a lot of work to hand draw all these icons.)
>> 
>> Hi, I'm interested in help to convert the icons into xpm and bpm, i
>> think the process would be faster if the original icons are in svg
>> otherwise i can make my best effort in help.
>
> That’s great news! You can find the svg icons I made in
> etc/images/scalable in the scratch/tango-icons branch. You can get
> that branch by
>
> git clone -b scratch/tango-icons git://git.sv.gnu.org/emacs.git
>
> That branch is modified to load the png icons in etc/images for the
> tool-bar (assuming you’re using a mac, on Linux Emacs will use the
> system icons).
>
> If you’d like to, feel free to improve the svg icons I made too. I
> also attached the svg tango and adwaita icons that I used, in case
> they’ll be useful.
>
>
>
>
> Yuan

Thanks, but in future, please resist the impulse to post an 11.5 MB
attachment to a public mailing list...



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  7:03         ` Yuan Fu
  2024-05-05  8:04           ` Po Lu
@ 2024-05-05  9:10           ` Eli Zaretskii
  2024-05-06  2:58             ` Yuan Fu
  1 sibling, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2024-05-05  9:10 UTC (permalink / raw)
  To: Yuan Fu; +Cc: luangruo, emacs-devel

> From: Yuan Fu <casouri@gmail.com>
> Date: Sun, 5 May 2024 00:03:05 -0700
> Cc: Eli Zaretskii <eliz@gnu.org>,
>  emacs-devel@gnu.org
> 
> 
> 
> > On May 4, 2024, at 11:41 PM, Po Lu <luangruo@yahoo.com> wrote:
> > 
> > Eli Zaretskii <eliz@gnu.org> writes:
> > 
> >> What do you mean by "works fine"?  Does the tool bar resize to
> >> accommodate the larger icons?  If not, what happens?
> > 
> > The NS and GTK toolbars resize icons to fit in themselves, and as such
> > their users are not in a position to notice problems arising from
> > inconsistently proportioned (or oversized) tool-bar icons.
> 
> And we actually want the icons to be “oversized” so they still look crisp on high-res displays.

I don't understand what that means in practice, sorry.  How do I tell
whether my display is high-res (it probably isn't), and what will
happen if it isn't, when using these icons?

My point is that if these icons need the tool bar to resize, that will
have two adverse effects:

  . the default geometry of the Emacs frame will change, something at
    least some Emacs users will not like, and it could get in the way
    of various minor but still important features like the splash
    screen, which depends on the window size
  . mixing these icons with the ones we have now will likely produce
    ugly results, thus requiring us to provide new counterparts fcor
    _all_ the icons, a much larger job




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
       [not found] <EDDF7D6A-E818-483A-AA98-CB2D093BCDAC@gmail.com>
  2024-05-04  9:48 ` Add Tango and Adwaita icons for the toolbar Po Lu
  2024-05-04 12:27 ` Eli Zaretskii
@ 2024-05-05 15:25 ` Dmitry Gutov
  2024-05-05 23:01 ` Rudolf Adamkovič
  3 siblings, 0 replies; 44+ messages in thread
From: Dmitry Gutov @ 2024-05-05 15:25 UTC (permalink / raw)
  To: Yuan Fu, Ergus via Emacs development discussions.

On 04/05/2024 12:20, Yuan Fu wrote:

> I followed the original tool-bar icon thread in 2022. At the time I didn’t have much time and I personally prefer colorful icons for the tool bar [1] (IMO mono-colored symbolic icons are more suitable for inline, small icons), so I didn’t do anything except for observing the discussion.
> 
> [1] I especially adore the life ring icon for help! Whatever icon set we use for the tool-bar, the help icon should always be a cute life ring :-)
> 
> The recent Emacs app icon thread reminded me of that thread, and I do have time now. So, I went ahead and searched for the Tango and Adwaita icons (basically the high-res version of the existing tool-bar icon that we use), then converted them to be suitable for Emacs tool-bar.
> 
> About 1/3 of the icons can be directly taken from Tango or Adwaita, the rest I have to modify or kind of take apart and re-assemble. Anyway, in the end I managed to get most of the basic icons covered. For details see etc/images/scalable/README.

This is exciting!

> You can see the attached screenshots for the current built-in icons and the new icons. I also attached the patch for it. You want to rebuild or byte-compile tool-bar.el for the new icons to take effect.
> 
> I hope these new icons won’t be controversial. As you can see, they are basically straight high-res upgrades for the existing icons. There are many imperfections that’ll be atrocious in the eyes of a graphic designer—I did the conversion work in an afternoon and I’m no where near a graphic designer; but it’s definitely an upgrade and we can always incrementally improve after.
> 
> If no one objects, I’ll happily push this to master.

The icons look good - definitely better than what we had before. And 
it's the same set, so...



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  0:08     ` Po Lu
@ 2024-05-05 15:42       ` Dmitry Gutov
  2024-05-06  3:01         ` Yuan Fu
  0 siblings, 1 reply; 44+ messages in thread
From: Dmitry Gutov @ 2024-05-05 15:42 UTC (permalink / raw)
  To: Po Lu, Yuan Fu; +Cc: Eli Zaretskii, emacs-devel

On 05/05/2024 03:08, Po Lu wrote:
> Yuan Fu<casouri@gmail.com>  writes:
> 
>> They’re not the same size. The new icons are 64x64. It works fine on
>> my machine, but I don’t know about on Linux. I'll test it on my Linux
>> machine, but how do you make Emacs use the built-in icons instead of
>> system icons on Linux?
> In this instance, building Emacs --with-x-toolkit=no.

For some reason or other, toolbar looks oversized with the new icons 
when using the Lucid toolkit build (or with "no toolkit").

It looks like the big icons are used, and then scaled 2x on top of that 
(because my desktop scaling is 2x).

I don't know how big of a problem that really is, but so far this is the 
main way for me to try out the new icons (the gtk3 build has its own).




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  6:41       ` Po Lu
  2024-05-05  7:03         ` Yuan Fu
@ 2024-05-05 17:06         ` Max Nikulin
  1 sibling, 0 replies; 44+ messages in thread
From: Max Nikulin @ 2024-05-05 17:06 UTC (permalink / raw)
  To: emacs-devel

On 05/05/2024 13:41, Po Lu wrote:
> 
> The NS and GTK toolbars resize icons to fit in themselves, and as such
> their users are not in a position to notice problems arising from
> inconsistently proportioned (or oversized) tool-bar icons.

There are issues with size of some icons from system-wide theme:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23847





^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
       [not found] <EDDF7D6A-E818-483A-AA98-CB2D093BCDAC@gmail.com>
                   ` (2 preceding siblings ...)
  2024-05-05 15:25 ` Dmitry Gutov
@ 2024-05-05 23:01 ` Rudolf Adamkovič
  3 siblings, 0 replies; 44+ messages in thread
From: Rudolf Adamkovič @ 2024-05-05 23:01 UTC (permalink / raw)
  To: Yuan Fu, Ergus via Emacs development discussions.

Yuan Fu <casouri@gmail.com> writes:

> [...], and I do have time now. So, I went ahead and [...]

Thank you for working on this.

Rudy
-- 
"The whole science is nothing more than a refinement of everyday
thinking."  --- Albert Einstein, 1879-1955

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
Studenohorská 25, 84103 Bratislava, Slovakia, European Union



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  8:07   ` Po Lu
@ 2024-05-06  0:10     ` Yuan Fu
  0 siblings, 0 replies; 44+ messages in thread
From: Yuan Fu @ 2024-05-06  0:10 UTC (permalink / raw)
  To: Po Lu; +Cc: Elijah G, emacs-devel



> On May 5, 2024, at 1:07 AM, Po Lu <luangruo@yahoo.com> wrote:
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
>>> On May 4, 2024, at 9:07 PM, Elijah G <eg642616@gmail.com> wrote:
>>> 
>>> Yuan Fu <casouri@gmail.com> writes:
>>>> I certainly would like to have xpm and bpm versions for the new
>>>> icons, but as I said, I’m no graphic designer and have no ability to hand-draw 
>>>> them; the only thing I can do is to convert them from png, which you also
>>>> against. (Though, to be fair, even if I have the
>>>> ability, I probably wouldn’t want to, it’s a lot of work to hand draw all these icons.)
>>> 
>>> Hi, I'm interested in help to convert the icons into xpm and bpm, i
>>> think the process would be faster if the original icons are in svg
>>> otherwise i can make my best effort in help.
>> 
>> That’s great news! You can find the svg icons I made in
>> etc/images/scalable in the scratch/tango-icons branch. You can get
>> that branch by
>> 
>> git clone -b scratch/tango-icons git://git.sv.gnu.org/emacs.git
>> 
>> That branch is modified to load the png icons in etc/images for the
>> tool-bar (assuming you’re using a mac, on Linux Emacs will use the
>> system icons).
>> 
>> If you’d like to, feel free to improve the svg icons I made too. I
>> also attached the svg tango and adwaita icons that I used, in case
>> they’ll be useful.
>> 
>> 
>> 
>> 
>> Yuan
> 
> Thanks, but in future, please resist the impulse to post an 11.5 MB
> attachment to a public mailing list…

Ohhhh, right… :-( Should I contact someone to remove it from the archive or something?

Yuan




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05  9:10           ` Eli Zaretskii
@ 2024-05-06  2:58             ` Yuan Fu
  2024-05-06 11:00               ` Eli Zaretskii
  0 siblings, 1 reply; 44+ messages in thread
From: Yuan Fu @ 2024-05-06  2:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, emacs-devel



> On May 5, 2024, at 2:10 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Sun, 5 May 2024 00:03:05 -0700
>> Cc: Eli Zaretskii <eliz@gnu.org>,
>> emacs-devel@gnu.org
>> 
>> 
>> 
>>> On May 4, 2024, at 11:41 PM, Po Lu <luangruo@yahoo.com> wrote:
>>> 
>>> Eli Zaretskii <eliz@gnu.org> writes:
>>> 
>>>> What do you mean by "works fine"?  Does the tool bar resize to
>>>> accommodate the larger icons?  If not, what happens?
>>> 
>>> The NS and GTK toolbars resize icons to fit in themselves, and as such
>>> their users are not in a position to notice problems arising from
>>> inconsistently proportioned (or oversized) tool-bar icons.
>> 
>> And we actually want the icons to be “oversized” so they still look crisp on high-res displays.
> 
> I don't understand what that means in practice, sorry.  How do I tell
> whether my display is high-res (it probably isn't), and what will
> happen if it isn't, when using these icons?

That’s what we need to figure out. Ideally we want to use 64x64 images for high-res displays, and 32x32 for normal displays, and on both displays the icons should have the same physical size on the glass. On NS port this seems to work automatically: you give it 64x64 images and the system scales them to fit the toolbar. We need to figure out what needs to be done for GTK and other term for the icons to look good and have the right size.

> My point is that if these icons need the tool bar to resize, that will
> have two adverse effects:

The tool bar keeps its size, and resizes the icons to fit in the tool bar, not the other way around (at least on NS port, on other ports we want to achieve the same effect)

Yuan




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-05 15:42       ` Dmitry Gutov
@ 2024-05-06  3:01         ` Yuan Fu
  0 siblings, 0 replies; 44+ messages in thread
From: Yuan Fu @ 2024-05-06  3:01 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Po Lu, Eli Zaretskii, emacs-devel



> On May 5, 2024, at 8:42 AM, Dmitry Gutov <dmitry@gutov.dev> wrote:
> 
> On 05/05/2024 03:08, Po Lu wrote:
>> Yuan Fu<casouri@gmail.com>  writes:
>>> They’re not the same size. The new icons are 64x64. It works fine on
>>> my machine, but I don’t know about on Linux. I'll test it on my Linux
>>> machine, but how do you make Emacs use the built-in icons instead of
>>> system icons on Linux?
>> In this instance, building Emacs --with-x-toolkit=no.
> 
> For some reason or other, toolbar looks oversized with the new icons when using the Lucid toolkit build (or with "no toolkit").

Yeah I saw that too with “no toolkit” build. 

> 
> It looks like the big icons are used, and then scaled 2x on top of that (because my desktop scaling is 2x).
> 
> I don't know how big of a problem that really is, but so far this is the main way for me to try out the new icons (the gtk3 build has its own).

We can generate 32x32 icons and use those. But for scaled desktop (like yours), Emacs should use 64x64 icons rather than scaling 32x32 up. I’m not sure how to instruct Emacs to do that, or if it’s even possible.

Yuan


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
       [not found] ` <15F31342-2F2E-4F1E-9FE2-D8F1A62BCC5A@gmail.com>
  2024-05-05  7:06   ` Yuan Fu
  2024-05-05  8:07   ` Po Lu
@ 2024-05-06  5:10   ` Elijah G
  2024-05-06  5:32     ` Yuan Fu
  2 siblings, 1 reply; 44+ messages in thread
From: Elijah G @ 2024-05-06  5:10 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel, Po Lu

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

El dom., 5 de mayo de 2024 12:57 a. m., Yuan Fu <casouri@gmail.com>
escribió:

>
>
> > On May 4, 2024, at 9:07 PM, Elijah G <eg642616@gmail.com> wrote:
> >
> > Yuan Fu <casouri@gmail.com> writes:
> > > I certainly would like to have xpm and bpm versions for the new
> > > icons, but as I said, I’m no graphic designer and have no ability to
> hand-draw
> > > them; the only thing I can do is to convert them from png, which you
> also
> > > against. (Though, to be fair, even if I have the
> > > ability, I probably wouldn’t want to, it’s a lot of work to hand draw
> all these icons.)
> >
> > Hi, I'm interested in help to convert the icons into xpm and bpm, i
> think the process would be faster if the original icons are in svg
> otherwise i can make my best effort in help.
>
> That’s great news! You can find the svg icons I made in
> etc/images/scalable in the scratch/tango-icons branch. You can get that
> branch by
>
> git clone -b scratch/tango-icons git://git.sv.gnu.org/emacs.git
>
> That branch is modified to load the png icons in etc/images for the
> tool-bar (assuming you’re using a mac, on Linux Emacs will use the system
> icons).
>
> If you’d like to, feel free to improve the svg icons I made too. I also
> attached the svg tango and adwaita icons that I used, in case they’ll be
> useful.
>

Thank you, i have a question, should i send a patch to this thread when i
have the icons?

Also i've also read etc/images/scalable README file about some missing
icons, i would like also provide them by myself keeping the tango (or
adwaita) style.

>

[-- Attachment #2: Type: text/html, Size: 2437 bytes --]

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-06  5:10   ` Elijah G
@ 2024-05-06  5:32     ` Yuan Fu
  2024-05-07  4:18       ` Elijah G
  0 siblings, 1 reply; 44+ messages in thread
From: Yuan Fu @ 2024-05-06  5:32 UTC (permalink / raw)
  To: Elijah G; +Cc: emacs-devel, Po Lu



> On May 5, 2024, at 10:10 PM, Elijah G <eg642616@gmail.com> wrote:
> 
> El dom., 5 de mayo de 2024 12:57 a. m., Yuan Fu <casouri@gmail.com> escribió:
> 
> 
> > On May 4, 2024, at 9:07 PM, Elijah G <eg642616@gmail.com> wrote:
> > 
> > Yuan Fu <casouri@gmail.com> writes:
> > > I certainly would like to have xpm and bpm versions for the new
> > > icons, but as I said, I’m no graphic designer and have no ability to hand-draw 
> > > them; the only thing I can do is to convert them from png, which you also
> > > against. (Though, to be fair, even if I have the
> > > ability, I probably wouldn’t want to, it’s a lot of work to hand draw all these icons.)
> > 
> > Hi, I'm interested in help to convert the icons into xpm and bpm, i think the process would be faster if the original icons are in svg otherwise i can make my best effort in help.
> 
> That’s great news! You can find the svg icons I made in etc/images/scalable in the scratch/tango-icons branch. You can get that branch by
> 
> git clone -b scratch/tango-icons git://git.sv.gnu.org/emacs.git
> 
> That branch is modified to load the png icons in etc/images for the tool-bar (assuming you’re using a mac, on Linux Emacs will use the system icons).
> 
> If you’d like to, feel free to improve the svg icons I made too. I also attached the svg tango and adwaita icons that I used, in case they’ll be useful.
> 
> Thank you, i have a question, should i send a patch to this thread when i have the icons?

Sending large files on the mailing list doesn’t seem like a good idea, maybe we can collaborate on GitHub/sourcehut? Let me know which one you’d prefer, or if you have better ideas.

> Also i've also read etc/images/scalable README file about some missing icons, i would like also provide them by myself keeping the tango (or adwaita) style.

That’s great! If you don’t mind, maybe also look at the icon for index. The current xpm icon has a hand plus a page, the one I made is missing the hand. 

Yuan 


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-06  2:58             ` Yuan Fu
@ 2024-05-06 11:00               ` Eli Zaretskii
  2024-05-06 11:24                 ` Po Lu
  2024-05-08  0:25                 ` Yuan Fu
  0 siblings, 2 replies; 44+ messages in thread
From: Eli Zaretskii @ 2024-05-06 11:00 UTC (permalink / raw)
  To: Yuan Fu; +Cc: luangruo, emacs-devel

> From: Yuan Fu <casouri@gmail.com>
> Date: Sun, 5 May 2024 19:58:45 -0700
> Cc: luangruo@yahoo.com,
>  emacs-devel@gnu.org
> 
> > My point is that if these icons need the tool bar to resize, that will
> > have two adverse effects:
> 
> The tool bar keeps its size, and resizes the icons to fit in the tool bar, not the other way around (at least on NS port, on other ports we want to achieve the same effect)

How will you do that?  Emacs supports image resizing on (almost?) all
platforms, but the resize is a relatively expensive and
resource-wasteful operation, so I'd prefer to avoid that for
displaying tool-bar icons, something that we do frequently enough to
wish it to be fast and cheap.

So I think having two sets of icons would be preferable (assuming that
sizing down the icons you proposed will not hamper their quality,
something I do not expect to happen).



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-06 11:00               ` Eli Zaretskii
@ 2024-05-06 11:24                 ` Po Lu
  2024-05-08  0:25                 ` Yuan Fu
  1 sibling, 0 replies; 44+ messages in thread
From: Po Lu @ 2024-05-06 11:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Yuan Fu, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> How will you do that?  Emacs supports image resizing on (almost?)

"Almost" is correct.  Support is notably absent from Windows 9x and the
basic X configuration or on X servers without the XRender extension.

> platforms, but the resize is a relatively expensive and
> resource-wasteful operation, so I'd prefer to avoid that for
> displaying tool-bar icons, something that we do frequently enough to
> wish it to be fast and cheap.

Also true.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-06  5:32     ` Yuan Fu
@ 2024-05-07  4:18       ` Elijah G
  2024-05-08  0:22         ` Yuan Fu
  0 siblings, 1 reply; 44+ messages in thread
From: Elijah G @ 2024-05-07  4:18 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel, Po Lu

On Sun, May 5, 2024 at 11:32 PM Yuan Fu <casouri@gmail.com> wrote:
>
>
>
> > On May 5, 2024, at 10:10 PM, Elijah G <eg642616@gmail.com> wrote:
> >
> > El dom., 5 de mayo de 2024 12:57 a. m., Yuan Fu <casouri@gmail.com> escribió:
> >
> >
> > > On May 4, 2024, at 9:07 PM, Elijah G <eg642616@gmail.com> wrote:
> > >
> > > Yuan Fu <casouri@gmail.com> writes:
> > > > I certainly would like to have xpm and bpm versions for the new
> > > > icons, but as I said, I’m no graphic designer and have no ability to hand-draw
> > > > them; the only thing I can do is to convert them from png, which you also
> > > > against. (Though, to be fair, even if I have the
> > > > ability, I probably wouldn’t want to, it’s a lot of work to hand draw all these icons.)
> > >
> > > Hi, I'm interested in help to convert the icons into xpm and bpm, i think the process would be faster if the original icons are in svg otherwise i can make my best effort in help.
> >
> > That’s great news! You can find the svg icons I made in etc/images/scalable in the scratch/tango-icons branch. You can get that branch by
> >
> > git clone -b scratch/tango-icons git://git.sv.gnu.org/emacs.git
> >
> > That branch is modified to load the png icons in etc/images for the tool-bar (assuming you’re using a mac, on Linux Emacs will use the system icons).
> >
> > If you’d like to, feel free to improve the svg icons I made too. I also attached the svg tango and adwaita icons that I used, in case they’ll be useful.
> >
> > Thank you, i have a question, should i send a patch to this thread when i have the icons?
>
> Sending large files on the mailing list doesn’t seem like a good idea, maybe we can collaborate on GitHub/sourcehut? Let me know which one you’d prefer, or if you have better ideas.

I prefer using GitHub since I don't know how to use sourcehut,
i've created a repo where its stored the icons that i made + patch file,

https://github.com/DevelopmentCool2449/emacs/tree/scratch/tango-icons

Patch file: https://raw.githubusercontent.com/DevelopmentCool2449/emacs/scratch/tango-icons/PATCH-0001-Convert-and-change-tango-icons-to-xpm-and-pbm.patch

Currently i only completed some icons, i will try to complete the remain
the next days.

But in short, the xpm and pbm are a little different from the originals,
(i had to make ones by hand), i've recolored the close.* icons to a red-ish one.
Now i've added 1 hand to index.* icons (it may be a bit ugly since i
find hard drawing hands)

if anyone have any commentary, i would gladly listen them.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-07  4:18       ` Elijah G
@ 2024-05-08  0:22         ` Yuan Fu
  2024-05-08  3:19           ` Elijah G
  2024-05-09  3:52           ` Elijah G
  0 siblings, 2 replies; 44+ messages in thread
From: Yuan Fu @ 2024-05-08  0:22 UTC (permalink / raw)
  To: Elijah G; +Cc: Ergus via Emacs development discussions., Po Lu



> On May 6, 2024, at 9:18 PM, Elijah G <eg642616@gmail.com> wrote:
> 
> On Sun, May 5, 2024 at 11:32 PM Yuan Fu <casouri@gmail.com> wrote:
>> 
>> 
>> 
>>> On May 5, 2024, at 10:10 PM, Elijah G <eg642616@gmail.com> wrote:
>>> 
>>> El dom., 5 de mayo de 2024 12:57 a. m., Yuan Fu <casouri@gmail.com> escribió:
>>> 
>>> 
>>>> On May 4, 2024, at 9:07 PM, Elijah G <eg642616@gmail.com> wrote:
>>>> 
>>>> Yuan Fu <casouri@gmail.com> writes:
>>>>> I certainly would like to have xpm and bpm versions for the new
>>>>> icons, but as I said, I’m no graphic designer and have no ability to hand-draw
>>>>> them; the only thing I can do is to convert them from png, which you also
>>>>> against. (Though, to be fair, even if I have the
>>>>> ability, I probably wouldn’t want to, it’s a lot of work to hand draw all these icons.)
>>>> 
>>>> Hi, I'm interested in help to convert the icons into xpm and bpm, i think the process would be faster if the original icons are in svg otherwise i can make my best effort in help.
>>> 
>>> That’s great news! You can find the svg icons I made in etc/images/scalable in the scratch/tango-icons branch. You can get that branch by
>>> 
>>> git clone -b scratch/tango-icons git://git.sv.gnu.org/emacs.git
>>> 
>>> That branch is modified to load the png icons in etc/images for the tool-bar (assuming you’re using a mac, on Linux Emacs will use the system icons).
>>> 
>>> If you’d like to, feel free to improve the svg icons I made too. I also attached the svg tango and adwaita icons that I used, in case they’ll be useful.
>>> 
>>> Thank you, i have a question, should i send a patch to this thread when i have the icons?
>> 
>> Sending large files on the mailing list doesn’t seem like a good idea, maybe we can collaborate on GitHub/sourcehut? Let me know which one you’d prefer, or if you have better ideas.
> 
> I prefer using GitHub since I don't know how to use sourcehut,
> i've created a repo where its stored the icons that i made + patch file,
> 
> https://github.com/DevelopmentCool2449/emacs/tree/scratch/tango-icons
> 
> Patch file: https://raw.githubusercontent.com/DevelopmentCool2449/emacs/scratch/tango-icons/PATCH-0001-Convert-and-change-tango-icons-to-xpm-and-pbm.patch
> 
> Currently i only completed some icons, i will try to complete the remain
> the next days.
> 
> But in short, the xpm and pbm are a little different from the originals,
> (i had to make ones by hand), i've recolored the close.* icons to a red-ish one.
> Now i've added 1 hand to index.* icons (it may be a bit ugly since i
> find hard drawing hands)
> 
> if anyone have any commentary, i would gladly listen them.

Looks great!

I see that you replaced the current xpm and bpm with new files. I’m fine with that, but I wonder what others think.

Yuan




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-06 11:00               ` Eli Zaretskii
  2024-05-06 11:24                 ` Po Lu
@ 2024-05-08  0:25                 ` Yuan Fu
  2024-05-08  1:38                   ` Dmitry Gutov
  1 sibling, 1 reply; 44+ messages in thread
From: Yuan Fu @ 2024-05-08  0:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Po Lu, emacs-devel



> On May 6, 2024, at 4:00 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Sun, 5 May 2024 19:58:45 -0700
>> Cc: luangruo@yahoo.com,
>> emacs-devel@gnu.org
>> 
>>> My point is that if these icons need the tool bar to resize, that will
>>> have two adverse effects:
>> 
>> The tool bar keeps its size, and resizes the icons to fit in the tool bar, not the other way around (at least on NS port, on other ports we want to achieve the same effect)
> 
> How will you do that?  Emacs supports image resizing on (almost?) all
> platforms, but the resize is a relatively expensive and
> resource-wasteful operation, so I'd prefer to avoid that for
> displaying tool-bar icons, something that we do frequently enough to
> wish it to be fast and cheap.
> 
> So I think having two sets of icons would be preferable (assuming that
> sizing down the icons you proposed will not hamper their quality,
> something I do not expect to happen).

Yeah, my plan is to have two sets of icons. On NS, Emacs should use 64x64 icons. On Linux and other systems, Emacs will use 32x32 by default; if the screen scale is x2, then 64x64 icons should be used (this is the part I’m not sure how to implement at the moment).

Yuan


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-08  0:25                 ` Yuan Fu
@ 2024-05-08  1:38                   ` Dmitry Gutov
  2024-05-08  3:55                     ` Po Lu
  0 siblings, 1 reply; 44+ messages in thread
From: Dmitry Gutov @ 2024-05-08  1:38 UTC (permalink / raw)
  To: Yuan Fu, Eli Zaretskii; +Cc: Po Lu, emacs-devel

On 08/05/2024 03:25, Yuan Fu wrote:
> Yeah, my plan is to have two sets of icons. On NS, Emacs should use 64x64 icons. On Linux and other systems, Emacs will use 32x32 by default; if the screen scale is x2, then 64x64 icons should be used (this is the part I’m not sure how to implement at the moment).

This will probably depend on the port. The ones I've tried (Lucid and 
"no", I think) don't scale the menus appropriately either.

Maybe the only Linux ports that support scaling already use different 
icon sets (from the GTK theme), but that could be turned off for 
testing, I guess by setting x-gtk-stock-map to nil?



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-08  0:22         ` Yuan Fu
@ 2024-05-08  3:19           ` Elijah G
  2024-05-09  3:52           ` Elijah G
  1 sibling, 0 replies; 44+ messages in thread
From: Elijah G @ 2024-05-08  3:19 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Ergus via Emacs development discussions., Po Lu

On Tue, May 7, 2024 at 6:22 PM Yuan Fu <casouri@gmail.com> wrote:
>
>
>
> > On May 6, 2024, at 9:18 PM, Elijah G <eg642616@gmail.com> wrote:
> >
> > On Sun, May 5, 2024 at 11:32 PM Yuan Fu <casouri@gmail.com> wrote:
> >>
> >>
> >>
> >>> On May 5, 2024, at 10:10 PM, Elijah G <eg642616@gmail.com> wrote:
> >>>
> >>> El dom., 5 de mayo de 2024 12:57 a. m., Yuan Fu <casouri@gmail.com> escribió:
> >>>
> >>>
> >>>> On May 4, 2024, at 9:07 PM, Elijah G <eg642616@gmail.com> wrote:
> >>>>
> >>>> Yuan Fu <casouri@gmail.com> writes:
> >>>>> I certainly would like to have xpm and bpm versions for the new
> >>>>> icons, but as I said, I’m no graphic designer and have no ability to hand-draw
> >>>>> them; the only thing I can do is to convert them from png, which you also
> >>>>> against. (Though, to be fair, even if I have the
> >>>>> ability, I probably wouldn’t want to, it’s a lot of work to hand draw all these icons.)
> >>>>
> >>>> Hi, I'm interested in help to convert the icons into xpm and bpm, i think the process would be faster if the original icons are in svg otherwise i can make my best effort in help.
> >>>
> >>> That’s great news! You can find the svg icons I made in etc/images/scalable in the scratch/tango-icons branch. You can get that branch by
> >>>
> >>> git clone -b scratch/tango-icons git://git.sv.gnu.org/emacs.git
> >>>
> >>> That branch is modified to load the png icons in etc/images for the tool-bar (assuming you’re using a mac, on Linux Emacs will use the system icons).
> >>>
> >>> If you’d like to, feel free to improve the svg icons I made too. I also attached the svg tango and adwaita icons that I used, in case they’ll be useful.
> >>>
> >>> Thank you, i have a question, should i send a patch to this thread when i have the icons?
> >>
> >> Sending large files on the mailing list doesn’t seem like a good idea, maybe we can collaborate on GitHub/sourcehut? Let me know which one you’d prefer, or if you have better ideas.
> >
> > I prefer using GitHub since I don't know how to use sourcehut,
> > i've created a repo where its stored the icons that i made + patch file,
> >
> > https://github.com/DevelopmentCool2449/emacs/tree/scratch/tango-icons
> >
> > Patch file: https://raw.githubusercontent.com/DevelopmentCool2449/emacs/scratch/tango-icons/PATCH-0001-Convert-and-change-tango-icons-to-xpm-and-pbm.patch
> >
> > Currently i only completed some icons, i will try to complete the remain
> > the next days.
> >
> > But in short, the xpm and pbm are a little different from the originals,
> > (i had to make ones by hand), i've recolored the close.* icons to a red-ish one.
> > Now i've added 1 hand to index.* icons (it may be a bit ugly since i
> > find hard drawing hands)
> >
> > if anyone have any commentary, i would gladly listen them.
>
> Looks great!
>
> I see that you replaced the current xpm and bpm with new files. I’m fine with that, but I wonder what others think.

It's only temporary, I had to do that to test them in Windows, when I
have all the icons done I will move them to a separate folder.
Also watching this thread I was wondering why not add optional svg
icons if emacs supports it (and make them default), like how the
current icons in the toolbar does.
Windows port allows svg icons in the toolbar and resize them, svg has
more quality and allows better resize than png.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-08  1:38                   ` Dmitry Gutov
@ 2024-05-08  3:55                     ` Po Lu
  2024-05-08 13:44                       ` Dmitry Gutov
  0 siblings, 1 reply; 44+ messages in thread
From: Po Lu @ 2024-05-08  3:55 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Yuan Fu, Eli Zaretskii, emacs-devel

Dmitry Gutov <dmitry@gutov.dev> writes:

> This will probably depend on the port. The ones I've tried (Lucid and
> "no", I think) don't scale the menus appropriately either.

Lucid menus should scale with Xft.dpi.  If this resource is not set,
well, not our problem.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-08  3:55                     ` Po Lu
@ 2024-05-08 13:44                       ` Dmitry Gutov
  0 siblings, 0 replies; 44+ messages in thread
From: Dmitry Gutov @ 2024-05-08 13:44 UTC (permalink / raw)
  To: Po Lu; +Cc: Yuan Fu, Eli Zaretskii, emacs-devel

On 08/05/2024 06:55, Po Lu wrote:
> Dmitry Gutov<dmitry@gutov.dev>  writes:
> 
>> This will probably depend on the port. The ones I've tried (Lucid and
>> "no", I think) don't scale the menus appropriately either.
> Lucid menus should scale with Xft.dpi.  If this resource is not set,
> well, not our problem.

Hmm, it seems that was only a problem with the "no toolkit" build.

I've rebuilt with Lucid, and the menus look fine.

But the toolbar icons are still 2x the size they should be :-(



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-08  0:22         ` Yuan Fu
  2024-05-08  3:19           ` Elijah G
@ 2024-05-09  3:52           ` Elijah G
  2024-05-09  4:50             ` Yuan Fu
  1 sibling, 1 reply; 44+ messages in thread
From: Elijah G @ 2024-05-09  3:52 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Ergus via Emacs development discussions., Po Lu

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

Good news,
I've completed the icons and added a
few, i couldn't provide new icons to mh-logo,
sort-row-ascending and sort-column-ascending
(the first one due i don't know what `mh' means and the others due I
couldn't think in a good design).
I had plans for provide new icons in png for modifier keys icons from
modifier-bar-mode from android port but i dont know if there is interest in
that.
The new icons can be found in the
etc/images/tango folder from my repo.

Also sorry If this is off topic:

Also i would like to know if there are plans for
add a redo button in the tool-bar, there is a redo
button in menu-bar Edit section but no in the
tool-bar.

I case there are plans im sending here a little
snippet that i use in my setup if this can help:
(tool-bar-add-item-from-menu 'undo-redo "redo" nil)

  (keymap-set-after (default-value 'tool-bar-map) "<undo-redo>"
    (cdr (assq 'undo-redo tool-bar-map))
    'undo)

[-- Attachment #2: Type: text/html, Size: 1492 bytes --]

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-09  3:52           ` Elijah G
@ 2024-05-09  4:50             ` Yuan Fu
  2024-05-10  2:04               ` Elijah G.
  0 siblings, 1 reply; 44+ messages in thread
From: Yuan Fu @ 2024-05-09  4:50 UTC (permalink / raw)
  To: Elijah G; +Cc: Ergus via Emacs development discussions., Po Lu



> On May 8, 2024, at 8:52 PM, Elijah G <eg642616@gmail.com> wrote:
> 
> Good news,
> I've completed the icons and added a
> few, i couldn't provide new icons to mh-logo,
> sort-row-ascending and sort-column-ascending
> (the first one due i don't know what `mh' means and the others due I couldn't think in a good design).
> I had plans for provide new icons in png for modifier keys icons from modifier-bar-mode from android port but i dont know if there is interest in that.
> The new icons can be found in the
> etc/images/tango folder from my repo.

I think they look great! I also like the red close icon, that’ll be more friendly to dark themes. The remaining work is to figure out how to correctly load the icons into toolbar. We also need some way to opt-out of the new icons. I’ll try to figure it out.

Yuan




^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-09  4:50             ` Yuan Fu
@ 2024-05-10  2:04               ` Elijah G.
  2024-05-10  7:06                 ` Eli Zaretskii
  0 siblings, 1 reply; 44+ messages in thread
From: Elijah G. @ 2024-05-10  2:04 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel, Po Lu

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

Yuan Fu <casouri@gmail.com> writes:

>> On May 8, 2024, at 8:52 PM, Elijah G <eg642616@gmail.com> wrote:
>> 
>> Good news,
>> I've completed the icons and added a
>> few, i couldn't provide new icons to mh-logo,
>> sort-row-ascending and sort-column-ascending
>> (the first one due i don't know what `mh' means and the others due I couldn't think in a good design).
>> I had plans for provide new icons in png for modifier keys icons from modifier-bar-mode from android port but i dont know if there is interest in that.
>> The new icons can be found in the
>> etc/images/tango folder from my repo.
>
> We also need some way to opt-out of the new icons. I’ll try to figure
> it out.

I've made a litle patch that can help in that (note: I've not tested it
yet and i don't think i can test it :( ).
The new icons are enabled by default but it can be switched to the
current ones (also i think that defcustom should specify that it must
be set in early-init.el because AFAIK tool-bar can not refresh the icons).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: PATCH --]
[-- Type: text/x-patch, Size: 2833 bytes --]

From 2531aebfd21de84261834d189fda87844e92b1f5 Mon Sep 17 00:00:00 2001
From: "Elias G. Perez" <eg642616@gmail.com>
Date: Thu, 9 May 2024 19:18:43 -0600
Subject: [PATCH] SVG and tango icon theme support

---
 lisp/tool-bar.el | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 20efddb..d183123 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -211,25 +211,43 @@ To define items in any other map, use `tool-bar-local-item'."
   (apply #'tool-bar-local-item icon def key tool-bar-map props)
   (tool-bar--flush-cache))
 
+(defcustom tool-bar-icon-theme 'tango
+  "Specify icon theme for tool-bar.
+Possible values are `tango' and `classic'"
+  :type 'symbol)
+
 (defun tool-bar--image-expression (icon)
   "Return an expression that evaluates to an image spec for ICON."
   (let* ((fg (face-attribute 'tool-bar :foreground))
 	 (bg (face-attribute 'tool-bar :background))
 	 (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
 			(if (eq bg 'unspecified) nil (list :background bg))))
-	 (xpm-spec (list :type 'xpm :file (concat icon ".xpm")))
+	 (xpm-spec (list :type 'xpm :file
+                         (concat icon
+                                 (if (eq tool-bar-icon-theme 'tango) "tango/")
+                                 ".xpm")))
 	 (xpm-lo-spec (list :type 'xpm :file
 			    (concat "low-color/" icon ".xpm")))
 	 (pbm-spec (append (list :type 'pbm :file
-                                 (concat icon ".pbm")) colors))
+                                 (concat icon
+                                         (if (eq tool-bar-icon-theme 'tango) "tango/")
+                                         ".pbm")) colors))
 	 (xbm-spec (append (list :type 'xbm :file
                                  (concat icon ".xbm")) colors))
          (png-spec (append (list :type 'png :file
-                                 (concat icon ".png")) colors)))
+                                 (concat icon
+                                         (if (eq tool-bar-icon-theme 'tango) "tango/")
+                                         ".png")) colors))
+         (svg-spec (append (list :type 'svg :file
+                                 (concat icon
+                                         (if (eq tool-bar-icon-theme 'tango) "tango/")
+                                         ".svg")) colors)))
     `(find-image (cond ((not (display-color-p))
 			',(list pbm-spec xbm-spec xpm-lo-spec xpm-spec))
 		       ((< (display-color-cells) 256)
 			',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec))
+                       ((fboundp 'svg-image)
+                        ',(list png-spec xpm-spec pbm-spec xbm-spec svg-spec))
 		       (t
 			',(list png-spec xpm-spec pbm-spec xbm-spec)))
                  t)))
-- 
2.44.0.windows.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-10  2:04               ` Elijah G.
@ 2024-05-10  7:06                 ` Eli Zaretskii
  2024-05-10 15:43                   ` Elijah G.
  0 siblings, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2024-05-10  7:06 UTC (permalink / raw)
  To: Elijah G.; +Cc: casouri, emacs-devel, luangruo

> From: "Elijah G." <eg642616@gmail.com>
> Cc: <emacs-devel@gnu.org>,  Po Lu <luangruo@yahoo.com>
> Date: Thu, 09 May 2024 20:04:03 -0600
> 
> > We also need some way to opt-out of the new icons. I’ll try to figure
> > it out.
> 
> I've made a litle patch that can help in that (note: I've not tested it
> yet and i don't think i can test it :( ).
> The new icons are enabled by default but it can be switched to the
> current ones (also i think that defcustom should specify that it must
> be set in early-init.el because AFAIK tool-bar can not refresh the icons).

Is "tool-bar theme" really a good idea for this?  AFAIK, we didn't
decide to introduce "tool-bar themes", and so doing this as part of
adding new icons is not TRT, it should be a separate and
well-documented decision, since the results are visible to users.

> +	 (xpm-spec (list :type 'xpm :file
> +                         (concat icon
> +                                 (if (eq tool-bar-icon-theme 'tango) "tango/")
> +                                 ".xpm")))

Shouldn't you _prepend_ "tango/" to the icon's file name?

In any case, I find this way of implementing a tool-bar theme
inelegant: we'd need a test for each supported theme, which doesn't
scale.

This issue needs more thought and discussions.  Let's not mix the new
icons with this "theme" issue.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-10  7:06                 ` Eli Zaretskii
@ 2024-05-10 15:43                   ` Elijah G.
  2024-05-16  5:54                     ` Yuan Fu
  0 siblings, 1 reply; 44+ messages in thread
From: Elijah G. @ 2024-05-10 15:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: casouri, emacs-devel, luangruo

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

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "Elijah G." <eg642616@gmail.com>
>> Cc: <emacs-devel@gnu.org>,  Po Lu <luangruo@yahoo.com>
>> Date: Thu, 09 May 2024 20:04:03 -0600
>> 
>> > We also need some way to opt-out of the new icons. I’ll try to figure
>> > it out.
>> 
>> I've made a litle patch that can help in that (note: I've not tested it
>> yet and i don't think i can test it :( ).
>> The new icons are enabled by default but it can be switched to the
>> current ones (also i think that defcustom should specify that it must
>> be set in early-init.el because AFAIK tool-bar can not refresh the icons).
>
> Is "tool-bar theme" really a good idea for this?  AFAIK, we didn't
> decide to introduce "tool-bar themes", and so doing this as part of
> adding new icons is not TRT, it should be a separate and
> well-documented decision, since the results are visible to users.

I didn't mean a tool-bar theme, i didn't know how to name to that
defcustom so i thought in name it `tool-bar-icon-theme', i was thinking
in something like tool-bar-icon-style or similar since that patch
is only a draft.

>> +	 (xpm-spec (list :type 'xpm :file
>> +                         (concat icon
>> +                                 (if (eq tool-bar-icon-theme 'tango) "tango/")
>> +                                 ".xpm")))
>
> Shouldn't you _prepend_ "tango/" to the icon's file name?

Sorry i thought it was prepended it.

> In any case, I find this way of implementing a tool-bar theme
> inelegant: we'd need a test for each supported theme, which doesn't
> scale.
>
> This issue needs more thought and discussions.  Let's not mix the new
> icons with this "theme" issue.

Sorry, wasn't my intention making another issue, it was just an idea
based in the other messages of this thread about making the new icons
as an optional feature and allow change them to the original (current)
ones, this patch was intended to be used as base for this.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: FIXED PATCH --]
[-- Type: text/x-patch, Size: 2976 bytes --]

From 49019a3938269ae2ecf7e55df943e6808fb86eb6 Mon Sep 17 00:00:00 2001
From: "Elias G. Perez" <eg642616@gmail.com>
Date: Thu, 9 May 2024 19:18:43 -0600
Subject: [PATCH] SVG and tango icon theme support

---
 lisp/tool-bar.el | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 20efddb..5a466bf 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -211,25 +211,48 @@ To define items in any other map, use `tool-bar-local-item'."
   (apply #'tool-bar-local-item icon def key tool-bar-map props)
   (tool-bar--flush-cache))
 
+(defcustom tool-bar-icon-style 'tango
+  "Specify icon style to use in tool-bar.
+Possible values are `tango' and `classic'.
+
+If Emacs supports GTK it will use current icon theme.
+
+This variable should be set in your `early-init.el'."
+  :type 'symbol
+  :group 'frames)
+
 (defun tool-bar--image-expression (icon)
   "Return an expression that evaluates to an image spec for ICON."
   (let* ((fg (face-attribute 'tool-bar :foreground))
 	 (bg (face-attribute 'tool-bar :background))
 	 (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg))
 			(if (eq bg 'unspecified) nil (list :background bg))))
-	 (xpm-spec (list :type 'xpm :file (concat icon ".xpm")))
+	 (xpm-spec (list :type 'xpm :file
+                         (concat (if (eq tool-bar-icon-theme 'tango) "tango/")
+                                 icon
+                                 ".xpm")))
 	 (xpm-lo-spec (list :type 'xpm :file
 			    (concat "low-color/" icon ".xpm")))
 	 (pbm-spec (append (list :type 'pbm :file
-                                 (concat icon ".pbm")) colors))
+                                 (concat (if (eq tool-bar-icon-theme 'tango) "tango/")
+                                         icon
+                                         ".pbm")) colors))
 	 (xbm-spec (append (list :type 'xbm :file
                                  (concat icon ".xbm")) colors))
          (png-spec (append (list :type 'png :file
-                                 (concat icon ".png")) colors)))
+                                 (concat (if (eq tool-bar-icon-theme 'tango) "tango/")
+                                         icon
+                                         ".png")) colors))
+         (svg-spec (append (list :type 'svg :file
+                                 (concat (if (eq tool-bar-icon-theme 'tango) "tango/")
+                                         icon
+                                         ".svg")) colors)))
     `(find-image (cond ((not (display-color-p))
 			',(list pbm-spec xbm-spec xpm-lo-spec xpm-spec))
 		       ((< (display-color-cells) 256)
 			',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec))
+                       ((fboundp 'svg-image)
+                        ',(list png-spec xpm-spec pbm-spec xbm-spec svg-spec))
 		       (t
 			',(list png-spec xpm-spec pbm-spec xbm-spec)))
                  t)))
-- 
2.44.0.windows.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: Add Tango and Adwaita icons for the toolbar
  2024-05-10 15:43                   ` Elijah G.
@ 2024-05-16  5:54                     ` Yuan Fu
  0 siblings, 0 replies; 44+ messages in thread
From: Yuan Fu @ 2024-05-16  5:54 UTC (permalink / raw)
  To: Elijah G.; +Cc: Eli Zaretskii, emacs-devel, luangruo



> On May 10, 2024, at 8:43 AM, Elijah G. <eg642616@gmail.com> wrote:
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
>>> From: "Elijah G." <eg642616@gmail.com>
>>> Cc: <emacs-devel@gnu.org>,  Po Lu <luangruo@yahoo.com>
>>> Date: Thu, 09 May 2024 20:04:03 -0600
>>> 
>>>> We also need some way to opt-out of the new icons. I’ll try to figure
>>>> it out.
>>> 
>>> I've made a litle patch that can help in that (note: I've not tested it
>>> yet and i don't think i can test it :( ).
>>> The new icons are enabled by default but it can be switched to the
>>> current ones (also i think that defcustom should specify that it must
>>> be set in early-init.el because AFAIK tool-bar can not refresh the icons).
>> 
>> Is "tool-bar theme" really a good idea for this?  AFAIK, we didn't
>> decide to introduce "tool-bar themes", and so doing this as part of
>> adding new icons is not TRT, it should be a separate and
>> well-documented decision, since the results are visible to users.
> 
> I didn't mean a tool-bar theme, i didn't know how to name to that
> defcustom so i thought in name it `tool-bar-icon-theme', i was thinking
> in something like tool-bar-icon-style or similar since that patch
> is only a draft.
> 
>>> +  (xpm-spec (list :type 'xpm :file
>>> +                         (concat icon
>>> +                                 (if (eq tool-bar-icon-theme 'tango) "tango/")
>>> +                                 ".xpm")))
>> 
>> Shouldn't you _prepend_ "tango/" to the icon's file name?
> 
> Sorry i thought it was prepended it.
> 
>> In any case, I find this way of implementing a tool-bar theme
>> inelegant: we'd need a test for each supported theme, which doesn't
>> scale.
>> 
>> This issue needs more thought and discussions.  Let's not mix the new
>> icons with this "theme" issue.
> 
> Sorry, wasn't my intention making another issue, it was just an idea
> based in the other messages of this thread about making the new icons
> as an optional feature and allow change them to the original (current)
> ones, this patch was intended to be used as base for this.

No need to be sorry, there’s nothing wrong suggesting a solution, whether or not it’s accepted in the end :-)

As for the “theme” issue, I agree it’s best to leave it out for now. I’m hoping to reuse Stefan K’s icon theme in icons.el (which is in the scratch/icons branch). And for us, we can just focus on _providing_ the icons for now, and not worry about how to make Emacs use them.

Yuan


^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2024-05-16  5:54 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <EDDF7D6A-E818-483A-AA98-CB2D093BCDAC@gmail.com>
2024-05-04  9:48 ` Add Tango and Adwaita icons for the toolbar Po Lu
2024-05-04 16:42   ` Yuan Fu
2024-05-05  0:22     ` Po Lu
2024-05-05  3:04       ` Yuan Fu
2024-05-05  4:14         ` Po Lu
2024-05-05  6:59           ` Yuan Fu
2024-05-05  6:01         ` Eli Zaretskii
2024-05-05  6:39           ` Po Lu
2024-05-05  5:55       ` Eli Zaretskii
2024-05-04 12:27 ` Eli Zaretskii
2024-05-04 21:27   ` Yuan Fu
2024-05-05  0:08     ` Po Lu
2024-05-05 15:42       ` Dmitry Gutov
2024-05-06  3:01         ` Yuan Fu
2024-05-05  5:33     ` Eli Zaretskii
2024-05-05  6:41       ` Po Lu
2024-05-05  7:03         ` Yuan Fu
2024-05-05  8:04           ` Po Lu
2024-05-05  9:10           ` Eli Zaretskii
2024-05-06  2:58             ` Yuan Fu
2024-05-06 11:00               ` Eli Zaretskii
2024-05-06 11:24                 ` Po Lu
2024-05-08  0:25                 ` Yuan Fu
2024-05-08  1:38                   ` Dmitry Gutov
2024-05-08  3:55                     ` Po Lu
2024-05-08 13:44                       ` Dmitry Gutov
2024-05-05 17:06         ` Max Nikulin
2024-05-05 15:25 ` Dmitry Gutov
2024-05-05 23:01 ` Rudolf Adamkovič
2024-05-05  4:07 Elijah G
     [not found] ` <15F31342-2F2E-4F1E-9FE2-D8F1A62BCC5A@gmail.com>
2024-05-05  7:06   ` Yuan Fu
2024-05-05  8:07   ` Po Lu
2024-05-06  0:10     ` Yuan Fu
2024-05-06  5:10   ` Elijah G
2024-05-06  5:32     ` Yuan Fu
2024-05-07  4:18       ` Elijah G
2024-05-08  0:22         ` Yuan Fu
2024-05-08  3:19           ` Elijah G
2024-05-09  3:52           ` Elijah G
2024-05-09  4:50             ` Yuan Fu
2024-05-10  2:04               ` Elijah G.
2024-05-10  7:06                 ` Eli Zaretskii
2024-05-10 15:43                   ` Elijah G.
2024-05-16  5:54                     ` Yuan Fu

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