fix(tray): mark tray icons as template for macOS
This commit is contained in:
parent
e92f94573e
commit
609fc7667b
2 changed files with 3 additions and 2 deletions
|
|
@ -92,7 +92,7 @@ pub fn run() {
|
||||||
.icon(Image::from_path(app.path().resolve(
|
.icon(Image::from_path(app.path().resolve(
|
||||||
"resources/tray_idle.png",
|
"resources/tray_idle.png",
|
||||||
tauri::path::BaseDirectory::Resource,
|
tauri::path::BaseDirectory::Resource,
|
||||||
)?)?)
|
)?)?.as_template(true))
|
||||||
.menu(&menu)
|
.menu(&menu)
|
||||||
.show_menu_on_left_click(true)
|
.show_menu_on_left_click(true)
|
||||||
.on_menu_event(|app, event| match event.id.as_ref() {
|
.on_menu_event(|app, event| match event.id.as_ref() {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,8 @@ pub fn change_tray_icon(app: &AppHandle, icon: TrayIconState) {
|
||||||
.resolve(icon_path, tauri::path::BaseDirectory::Resource)
|
.resolve(icon_path, tauri::path::BaseDirectory::Resource)
|
||||||
.expect("failed to resolve"),
|
.expect("failed to resolve"),
|
||||||
)
|
)
|
||||||
.expect("failed to set icon"),
|
.expect("failed to set icon")
|
||||||
|
.as_template(true),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue