fix(tray): mark tray icons as template for macOS

This commit is contained in:
Vlad Gerasimov 2025-07-28 18:53:25 +04:00
parent e92f94573e
commit 609fc7667b
2 changed files with 3 additions and 2 deletions

View file

@ -92,7 +92,7 @@ pub fn run() {
.icon(Image::from_path(app.path().resolve(
"resources/tray_idle.png",
tauri::path::BaseDirectory::Resource,
)?)?)
)?)?.as_template(true))
.menu(&menu)
.show_menu_on_left_click(true)
.on_menu_event(|app, event| match event.id.as_ref() {

View file

@ -91,7 +91,8 @@ pub fn change_tray_icon(app: &AppHandle, icon: TrayIconState) {
.resolve(icon_path, tauri::path::BaseDirectory::Resource)
.expect("failed to resolve"),
)
.expect("failed to set icon"),
.expect("failed to set icon")
.as_template(true),
));
}