Hide Dock Icon + Main Window
PascalPixel opened this issue ยท 6 comments
This is possible, but once implemented, both dock
and menu
will disappear (shortcuts will still be available, but without menus as hints, it will be difficult for users to remember them). If the menu is placed on the system tray, they would be stacked on top of each other, it will affect the user experience. I haven't thought of a good form of interaction yet.
#[cfg(target_os = "macos")]
app.set_activation_policy(tauri::ActivationPolicy::Prohibited);
I came up with a better form of interaction.
- If the app is still in the dock there are two ways to hide it:
- Triggered by the menu item
Menu -> Preferences -> Hide Dock Icon
- triggered by a right-click event on the system tray icon
- Triggered by the menu item
- When it needs to be in the dock there is only one way: it can only be restored by a right-click event on the system tray icon
Simply put, a right-click on the system tray icon is a two-way event (show โ hide
)
This is great! Some other macOS menubar apps I have that have the option to 'disable the dock icon and app switcher', seem to follow the pattern of:
- are you sure you want this mode? restart is required (ok)
- menu item left-click to toggle window
- menu item right-click to get app menu
If a system tray right-click menu is required, it would be a simple version of:
- Control Center
- Show Dock icon
- Quit
Control Center
is important and I am implementing exciting features for it.
Thanks @lencx !
You can check out readme, which also adds more exciting features, but was released in a bit of a hurry and is not yet fully adapted in the system tray.