Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tray): add support for tray icon themes #2809

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

yilmazcabuk
Copy link
Contributor

Description:

  • refactor(tray): improved tray icon setup and handling.

    • Fixed wrong icon showing for different player states.
    • Simplified tray icon setup by consolidating logic into reusable functions.
    • Replaced vague tray icon assets with clear play/pause icons for better clarity.
    • Improved code readability and maintainability by introducing helper functions and removing redundant code.
  • refactor: update tray icon.

    • Replaced the YouTube Music tray icon with a new play icon.
    • Ensures alignment with updated asset paths for consistency.
  • refactor(assets): updated tray icons.

    • Added new tray icons: pause.png and play.png.
    • Removed outdated icons: youtube-music-tray.png and youtube-music-tray-paused.png.
    • Enhances clarity and consistency of tray icon states.

Related Issues:

Changes:

  • Updated tray icons and logic for clarity and consistency.
  • Refactored code to reduce redundancy and improve maintainability.
  • Removed obsolete icons and added new assets.

Testing:

  • Verified icon transitions for play/pause states.
  • Ensured that new icons are being correctly used and old ones are removed.

- Added new tray icons: `pause.png` and `play.png`.
- Removed outdated icons: `youtube-music-tray.png` and `youtube-music-tray-paused.png`.
- Enhances clarity and consistency of tray icon states.
- Replaced the YouTube Music tray icon with a new play icon.
- Ensures alignment with updated asset paths for consistency.
- Fixed wrong icon showing for different player states.
- Simplified tray icon setup by consolidating logic into reusable functions.
- Replaced vague tray icon assets with clear play/pause icons for better clarity.
- Improved code readability and maintainability by introducing helper functions and removing redundant code.
assets/tray-icons/pause.png Outdated Show resolved Hide resolved
src/tray.ts Show resolved Hide resolved
src/tray.ts Show resolved Hide resolved
src/tray.ts Outdated Show resolved Hide resolved
src/tray.ts Outdated Show resolved Hide resolved
@JellyBrick JellyBrick added the enhancement New feature or request label Dec 31, 2024
- Introduced `TrayIconTheme` with options: Default, Fluent, and Material.
- Updated the tray menu and configuration to allow selecting tray icon themes.
- Refactored tray icon handling to dynamically load icons based on selected theme.
- Replaced inline songInfo type with the existing SongInfo interface.
@yilmazcabuk yilmazcabuk changed the title refactor(tray): improve tray setup and icon handling feat(tray): add support for tray icon themes Dec 31, 2024
- Added the IconSet interface to group play and pause icons.
- Replaced `createTrayIcons` with `createTrayIconSet` for better readability and maintainability.
- Adjusted functions to leverage IconSet, simplifying code and improving parameter handling.
- Encapsulated tray-related logic into smaller, focused functions.
- Introduced `AppContext` and `SongControls` interfaces for better structure.
- Centralized tray icon size into a constant.
- Simplified window visibility toggling with helper functions.
- Improved tooltip and menu configuration clarity.
- Replaced repetitive type prefixes with imported Electron types.
- Combined `hideWindowAndDock` and `showWindowAndDock` into a unified function.
- Modularized tray setup by separating icon creation and menu creation logic.
- Improved function readability by restructuring and renaming where needed.
- Fixed `setUpTray` function calls to use an object argument `{ app, win }` for consistent structure.
- Updated all relevant occurrences in `index.ts` and `menu.ts`.
Refactored `updateTrayTooltip` to destructure `isPaused` directly from `songInfo` for cleaner and more consistent logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add an option for a monochrome tray icon
2 participants