vladimiry / ElectronMail

Unofficial ProtonMail Desktop App
GNU General Public License v3.0
1.5k stars 96 forks source link

MacOS tray icon is now too big #505

Closed quarkl8 closed 2 years ago

quarkl8 commented 2 years ago

The tray icon in MacOS is now too large and still has a pixelated edge. It now stretches from the very top to the very bottom of the menu bar and doesn't match the other icons at all.

Screen Shot 2022-04-17 at 12 03 56 PM

How do other apps make their tray icons look clean-edged? Do they use a vector image?

vladimiry commented 2 years ago

Look like it depends on system version used. In #199 the "16x16 => 22x22" tray icon size increase was confirmed as an improvement on macOS 12.3 and so the new app version adopted the change.

How do other apps make their tray icons look clean-edged? Do they use a vector image?

Other likely use static images. The app builds a final icon using 128x128 size (adds unread indication, changes the color, etc) and then for macOS downscales it to 22x22 using Lanczos algorithm. Btw on Linux 128x128 icon size is used, the tray panel downscales it if needed, and the final icon looks well in the tray.

vladimiry commented 2 years ago

It won't be too hard to add the icon size option in the app settings. But I'd like to avoid doing this.

Look like it depends on system version used.

@quarkl8 so what is your OS version?

quarkl8 commented 2 years ago

@quarkl8 so what is your OS version?

I'm running the latest Monterey, version 12.3.1. I'm on a 2015 Retina if that matters. Also, thank you so much for creating this app, i'm complaining right now, haha, but it's really generous of you to be working so hard on it and it works well. I'd definitely donate to you if I had any money.

quarkl8 commented 2 years ago

Other likely use static images. The app builds a final icon using 128x128 size (adds unread indication, changes the color, etc) and then for macOS downscales it to 22x22 using Lanczos algorithm. Btw on Linux 128x128 icon size is used, the tray panel downscales it if needed, and the final icon looks well in the tray.

Is there a reason that using a static image for ElectronMail's tray icon wouldn't work?

vladimiry commented 2 years ago

Is there a reason that using a static image for ElectronMail's tray icon wouldn't work?

For example, dynamic data on the icon (like unread counter, changeable color, etc). Another reason is that I'd like the code logic to be the same for all systems. Like I said before, a Linux system is able to consume 128x128 icon and then downscale it if needed without breaking the sharpness, but macOS appears not to be smart in this case (since I have to downscale the icon 128x128 => 22x22 explicitly for this system).

Anyway, I still have no idea what are the tray icon size standards on the macOS system. For some users 16x16 work better but for other 22x22. Let's see what other macOS users have to say. If we don't settle on a specific icon size, I might have to add the respective option in the app settings.

vladimiry commented 2 years ago

Tray icon size customization is going to be available in the next release:

  • Enable support for tray icon size customization (#505). This should help with solving a rare case when the app tray icon stands out by its size from the rest of the tray icons. tray-icon-size
quarkl8 commented 2 years ago

Great, thanks @vladimiry!

macbugs commented 2 years ago

How do other apps make their tray icons look clean-edged? Do they use a vector image?

Look like it depends on system version used.

I believe you can only use SVG if the OS platform is 10.15 +

I'm on a 2015 Retina if that matters.

ah, ok... I do not have access to retina displays so I apologize for missing this issue. The icon reference document which I cited earlier was evidently for standard displays so I guess the 22 pixel limit on menu bar icons is multiplied by 2 on retina displays. If we neglect to specify high resolution equivalents for each icon size in the package, it appears that Mac OS will stretch the bitmap by 2x without interpolation, and this is obviously undesirable. The solution is expressed here:

Append a suffix of “@2x” to your @2x image names, and insert them into @2x fields in the asset catalog of your Xcode project.

The tray icon in MacOS is now too large

This is subjective: it would not stand out if you had many large icons. And you need these large icons in case some dysfunctional application or service starts filling up your SSD (or consuming excessive system resources). The ability to monitor system resource usage in real time is more important than matching the size of the native menu bar icons. Do you really think this looks bad? 😁

menubar2

Mac OS logs absolutely everything which occurs on the platform even when it is not needed for diagnostic purposes — including which application window the user selects with the mouse. This excessive logging is now showing up as rapid degradation of the (non-replaceable) SSD:

Many of the system daemons (and all iCloud-enabled applications) are constantly logging & reporting mundane user activities to Apple servers even when no iCloud account exists on the machine — and if you search for the name of those services you will find countless reports of excessive system resource usage due to bugs in the source code or the blocking of unnecessary traffic (which is a type of “unhandled exception” that Apple developers frequently do not account for.)

Mac OS has become so dependent on constant internet access that some system services can malfunction if the machine is online but data transmission is prevented by a firewall. Many people are working on ways to disable non-essential services, but that is beyond the scope of this discussion.

When the icon size of ElectronMail is reduced, the new message counter is also reduced to the point where it becomes illegible. There are hundreds of apps that employ larger menu bar icons — including apps which display charts & graphs (Stats & MenuMeters), most clock & calendar apps (World Clock), various VPN clients & Firewall apps, many Spotlight alternatives (more than 20 apps.)

Sometimes Apple is the greatest “offender” here — for example, you cannot disable the native Mac OS menu bar clock, so if you want to use a different font on the digital clock you need another app -- but you cannot hide the Mac OS analog clock, and this "large" icon is cropped & asymmetrical.

clock1

Here is the one from "World Clock" for comparison.

worldclock

...and here is actual size on a standard display.

2clocks

On iOS, Apple again violates its own design guidelines, which recommend a minimum contrast ratio of 4.5:1 between the text and background colors. In the iMessage application, the white text in a blue bubble has a 3.5:1 contrast ratio, but the white text in a green bubble on messages from Android users has a 2.1:1 contrast ratio, which is less than half the recommended minimum. On some versions of iOS, the ratio is 1.83. (The international "accessibility" standard requires a minimum contrast ratio of 3.0).

Even those with good vision may experience eye strain when reading text messages from Android users and resent the person messaging in that color. So I naturally support open source apps & operating systems because the user should have the power to fix things which are broken by design.

Btw on Linux 128x128 icon size is used, the tray panel downscales it if needed, and the final icon looks well in the tray.

With regard to our various discussions in this repo, I want to be perfectly clear that I am not marketing Apple products on github — but some of my clients have purchased Mac hardware due to a shortage of Intel components, and I still have to use Macs for development or tech support work. I support the development of cross-platform applications that provide a migration path to Linux & BSD because we should not become dependent on a single hardware vendor. But there are many off-grid users with solar or wind power who need to reduce energy consumption, and the energy efficiency of the M1 platform is exceptionally good. The M1 CPU has motivated other manufacturers to develop products which can match the energy/compute performance ratio of Apple silicon, and this demonstrates how competition benefits the consumer.

https://www.digitaltrends.com/computing/intel-arrow-lake-to-rival-apples-best-laptops/

https://www.techspot.com/news/88034-microsoft-rumored-developing-own-custom-arm-chips-servers.html

macbugs commented 2 years ago

According to the Mac OS documentation, supporting Retina displays will require scaling the original (1024-pixel) source image to 10 different sizes. But when I looked at the source image, I found that the current stock icon is slightly asymmetrical and has a white fringe that shows up on dark backgrounds at high resolutions. So I decided to make some new icons. I now have a set of 6 light & dark flat icon themes in neon/fluorescent style, compiled in Mac .ICNS format, including support for Retina displays, with preview catalog using standard Mac menu bar background colors:

Preview (dark)

These icons are designed to maintain contrast & minimize distortion at low resolutions when using the Lanczos algorithm. For cross-platform compatibility and various other purposes, I provide anti-aliased source images for each theme in .PNG format. For programatic color selection I include the same icon without color & anti-aliasing. I also made an experimental photo-realistic icon set (but then you could not change the color, so it would only work in the Finder & Dock.)

gitshow

@vladimiry: if you want any of these icon assets, please indicate where I should upload them.


The menu bar icon color control is a nice thing to have, but the icon size control does not work here (not that I need it to, 😉 --just wanted to report the issue.) @quarkl8, does this size control really work on your platform?

vladimiry commented 2 years ago

@macbugs, thanks for the research and icons proposal, but I don't think I'm going to change the current icons handling way in the app until I get a macOS device to independently test stuff (not happening in the near future). I'd consider getting M1 though when it gets decent Linux support, so I could set up a multi-OS/boot scenario.

macbugs commented 2 years ago

ok, no problem --I also used this as an excuse to test some design tools & filters... but in case you still need this information I provide the specifications:

I still have no idea what are the tray icon size standards on the macOS system.

quarkl8 commented 2 years ago

The menu bar icon color control is a nice thing to have, but the icon size control does not work here (not that I need it to, 😉 --just wanted to report the issue.) @quarkl8, does this size control really work on your platform?

Yes, size control works just fine!