|
|
@ -51,12 +51,19 @@ First you need to register the core plugin with Tauri:
|
|
|
|
`src-tauri/src/main.rs`
|
|
|
|
`src-tauri/src/main.rs`
|
|
|
|
|
|
|
|
|
|
|
|
```rust
|
|
|
|
```rust
|
|
|
|
|
|
|
|
use tauri::tray::TrayIconBuilder;
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
fn main() {
|
|
|
|
tauri::Builder::default()
|
|
|
|
tauri::Builder::default()
|
|
|
|
.plugin(tauri_plugin_positioner::init())
|
|
|
|
.plugin(tauri_plugin_positioner::init())
|
|
|
|
// This is required to get tray-relative positions to work
|
|
|
|
// This is required to get tray-relative positions to work
|
|
|
|
.on_system_tray_event(|app, event| {
|
|
|
|
.setup(|app| {
|
|
|
|
tauri_plugin_positioner::on_tray_event(app, &event);
|
|
|
|
TrayIconBuilder::new()
|
|
|
|
|
|
|
|
.on_tray_icon_event(|app, event| {
|
|
|
|
|
|
|
|
tauri_plugin_positioner::on_tray_event(app.app_handle(), &event);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.build(app)?;
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.run(tauri::generate_context!())
|
|
|
|
.run(tauri::generate_context!())
|
|
|
|
.expect("error while running tauri application");
|
|
|
|
.expect("error while running tauri application");
|
|
|
|