Add support close-to-tray option #667
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
close #294
close #70
close #389
Windows system tray integration:
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.Delegateto manage the system tray instance and handle commands related to the tray, such asTRAY_REMOVEDandQUIT_APP_CLEAN. [1] [2] [3]Playback commands:
PLAY_PAUSE_TOGGLEandTRAY_REMOVEDincmd.rsto support toggling playback and handling tray removal events. [1] [2]playback.rsto handle thePLAY_PAUSE_TOGGLEcommand, allowing users to toggle between play and pause states.Configuration updates:
close_to_trayfield to theConfigstruct, enabling users to configure whether closing the app minimizes it to the system tray instead of quitting. [1] [2]preferences.rsto include a checkbox for toggling the "close to tray" option.Dependency updates:
winapicrate with necessary features to support Windows system tray functionality inCargo.toml.