Function deskulpt::setup::init_system_tray

source ·
pub(crate) fn init_system_tray(app: &App) -> Result<(), Box<dyn Error>>
Expand description

Initialize the Deskulpt system tray.

This binds the menu and event handlers to the system tray with ID “deskulpt-tray”, see tauri.conf.json. Note that the cnavas click-through state is managed in this function as well! This tray would be intialized with the following features:

  • When left-clicking the tray icon or clicking the “toggle” menu item, toggle the click-through state of the canvas window. Note that left-clicking is unsupported on Linux, so the “toggle” menu item is present as a workaround.
  • When clicking the “manage” menu item, show the manager window.
  • When clicking the “exit” menu item, exit the application (with cleanup). This should, in production, be the only normal way to exit the application.