Add support close-to-tray option
This pull request introduces several changes to enhance functionality, improve user experience, and add support for system tray integration on Windows. The most significant updates include adding new commands for playback control, implementing a system tray feature for Windows, and updating the configuration and preferences UI to support the new "close to tray" behavior.
I avoid using the module because of compatibility issues with GTK or other related problems.
- [x] Windows Support
- [ ] Mac Support (can't test so hard to dev)
- [ ] Linux Support
close https://github.com/jpochyla/psst/issues/294 close https://github.com/jpochyla/psst/issues/70 close https://github.com/jpochyla/psst/issues/389
Windows system tray integration:
- Added
WindowsTraystruct in a new modulewindows_tray.rsto manage system tray functionality, including displaying a tray icon, handling right-click context menus, and responding to menu actions like playback control and application quit. - Updated
Delegateto manage the system tray instance and handle commands related to the tray, such asTRAY_REMOVEDandQUIT_APP_CLEAN. [1] [2] [3] - Added conditional compilation for Windows-specific tray functionality throughout the codebase. [1] [2]
Playback commands:
- Introduced new selectors
PLAY_PAUSE_TOGGLEandTRAY_REMOVEDincmd.rsto support toggling playback and handling tray removal events. [1] [2] - Updated
playback.rsto handle thePLAY_PAUSE_TOGGLEcommand, allowing users to toggle between play and pause states.
Configuration updates:
- Added a new
close_to_trayfield to theConfigstruct, enabling users to configure whether closing the app minimizes it to the system tray instead of quitting. [1] [2] - Updated the preferences UI in
preferences.rsto include a checkbox for toggling the "close to tray" option.
Dependency updates:
- Added
winapicrate with necessary features to support Windows system tray functionality inCargo.toml.
What is the progress of this? It's ready to merge?
I need to add support for linux and mac but I can't test mac. I think il will try to finish linux and merge without mac.