psst icon indicating copy to clipboard operation
psst copied to clipboard

Add support close-to-tray option

Open Cleboost opened this issue 6 months ago • 2 comments

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 WindowsTray struct in a new module windows_tray.rs to 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 Delegate to manage the system tray instance and handle commands related to the tray, such as TRAY_REMOVED and QUIT_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_TOGGLE and TRAY_REMOVED in cmd.rs to support toggling playback and handling tray removal events. [1] [2]
  • Updated playback.rs to handle the PLAY_PAUSE_TOGGLE command, allowing users to toggle between play and pause states.

Configuration updates:

  • Added a new close_to_tray field to the Config struct, 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.rs to include a checkbox for toggling the "close to tray" option.

Dependency updates:

  • Added winapi crate with necessary features to support Windows system tray functionality in Cargo.toml.

Cleboost avatar Jun 30 '25 19:06 Cleboost

What is the progress of this? It's ready to merge?

rottakore avatar Nov 27 '25 11:11 rottakore

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.

Cleboost avatar Nov 27 '25 12:11 Cleboost