lencx/ChatGPT

Hide Dock Icon + Main Window

PascalPixel opened this issue ยท 6 comments

Love the menubar dropdown, it's excellent! Can we get rid of the dock icon and main window altogether? ๐Ÿ˜„ It currently just 'hides' the main window when you click 'close'.

Screenshot 2022-12-15 at 15 20 21

Screenshot 2022-12-15 at 15 19 55

lencx commented

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);

tray-menu

lencx commented

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
  • 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)

chat-hide-dock

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
lencx commented

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 !

lencx commented

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.