Skip to content

fix: improve tray menu icon contrast on dark themes - #2481

Open
Utopia-V wants to merge 1 commit into
qier222:masterfrom
Utopia-V:fix/dark-tray-menu-icons
Open

Utopia-V wants to merge 1 commit into
qier222:masterfrom
Utopia-V:fix/dark-tray-menu-icons

Conversation

@Utopia-V

@Utopia-V Utopia-V commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • recolor the existing native tray menu item icons to match YesPlayMusic's resolved tray icon color
  • preserve the PNG alpha channel and antialiased edges without adding duplicate raster assets
  • leave the existing menu actions, accelerators, visibility state, and native hover behavior unchanged

Context

The tray menu currently always loads the same dark 16×16 PNGs for its menu items. On dark native menus, including Ubuntu 24.04 GNOME, those icons have very low contrast even though the menu text remains readable. This is the same underlying problem described in #740.

YesPlayMusic already resolves an Auto/Light/Dark color for its tray icon. This change uses the same resolved color when the menu is created. For a light-colored icon, it converts the existing monochrome PNG in memory with Electron's NativeImage API. Electron 13 uses premultiplied alpha for these bitmaps, so the RGB channels are set to the pixel's alpha value to preserve smooth edges.

The change is limited to icon construction in src/electron/tray.js; the existing Linux and Windows tray menu state handling remains intact.

Testing

  • targeted ESLint and Prettier checks for src/electron/tray.js
  • Electron 13.6.9 NativeImage round-trip probe covering all eight tray menu icon assets
  • Linux x64 electron:build --dir
  • manual Ubuntu 24.04/X11 GNOME verification: launched the patched build, opened the real top-panel menu, and confirmed that all item icons are clearly visible on the dark background

A pristine master build is currently blocked earlier by an existing Prettier error in src/views/settings.vue. For the full local build only, that pre-existing import was formatted temporarily and then restored; it is not included in this PR.

@Utopia-V
Utopia-V force-pushed the fix/dark-tray-menu-icons branch from ba6510f to 95f33b0 Compare August 31, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant