negue / meme-box

Manage and trigger media in OBS as a browser source
meme-box.vercel.app
GNU Affero General Public License v3.0
111 stars 16 forks source link

Create a more crisp tray icon #524

Closed dnaka91 closed 1 year ago

dnaka91 commented 1 year ago

This changes the tray icon generation, to have a more crisp variant, and apply scaling variations for HiDPI factors. It is very similar to the appreach mention in the docs where you'd have multiple icons like 32x32.png, 32x32@2.png and 32x32@3.png where the @2 and @3 variant are for double and triple DPI values.

This looks good on Linux so far. Seems macOS doesn't really care about the custom tray icon and builds the silouhette variant itself from the main app icon (at least it appears to do that, because the silouhette version looked crip, even before this change).

@negue could you check how this looks on Windows? I assume the original 16x16 was picked, because that's a typical basic size for ICO files on Windows. Just good to check that it doesn't fail to show the icon on Windows, and still looks crips there too. Sadly don't have a Windows PC around to check this myself.

Fixes #519

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
meme-box ✅ Ready (Inspect) Visit Preview Oct 4, 2022 at 5:05AM (UTC)
dnaka91 commented 1 year ago

After some testing on macOS, I figured that we can't just increase the default size to 32x32. Every platform behaves a little different and expects different sizes. So I opted for a platform specific solution, to best generate the icon for each platform, the way it expects it.

As a further note on Linux: So what further complicates things on Linux is the theming. People can install custom icon themes, that can override application/tray/desktop icons. That seems to work well for most native apps (gtk, qt, ... based). Electron works a bit different though, that it appears to the OS as just electron, and then on startup the bundled JS code (the actual app) tells it how to look. So theming of icons and such doesn't really seem to work here.

For example, most themes just define an SVG icon for the app & tray, so it looks crisp, no matter where. Sadly, Electron's API doesn't support SVGs, only PNG and JPG.

So all in all for now the Linux variant looks good enough in my opinion. Then, when someone with a different desktop environment has issues, we can adjust and fine tune further.

negue commented 1 year ago

Woah this is quite a nice solution, I searched backthen for something alike. I think with that most OS should be fine. :)

Thank you.

I tried it on Windows and it still looks good :)