Skip to content

Commit fbedd98

Browse files
committed
fix icon colors for macos
1 parent 0539c4d commit fbedd98

5 files changed

Lines changed: 4 additions & 0 deletions

File tree

-511 Bytes
Loading
556 Bytes
Loading
-319 Bytes
Loading
-1.66 KB
Loading

apps/desktop/src-tauri/src/tray.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ pub fn update_tray_icon_for_mode(app: &AppHandle, mode: RecordingMode) {
627627

628628
if let Ok(icon) = Image::from_bytes(get_mode_icon(mode)) {
629629
let _ = tray.set_icon(Some(icon));
630+
let _ = tray.set_icon_as_template(true);
630631
}
631632
}
632633

@@ -660,6 +661,7 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> {
660661

661662
let _ = TrayIconBuilder::with_id("tray")
662663
.icon(initial_icon)
664+
.icon_as_template(cfg!(target_os = "macos"))
663665
.menu(&menu)
664666
.show_menu_on_left_click(true)
665667
.on_menu_event({
@@ -887,6 +889,7 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> {
887889

888890
if let Ok(icon) = Image::from_bytes(include_bytes!("../icons/tray-stop-icon.png")) {
889891
let _ = tray.set_icon(Some(icon));
892+
let _ = tray.set_icon_as_template(true);
890893
}
891894
}
892895
});
@@ -908,6 +911,7 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> {
908911
let current_mode = get_current_mode(&app_handle);
909912
if let Ok(icon) = Image::from_bytes(get_mode_icon(current_mode)) {
910913
let _ = tray.set_icon(Some(icon));
914+
let _ = tray.set_icon_as_template(true);
911915
}
912916
}
913917
});

0 commit comments

Comments
 (0)