Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified apps/desktop/src-tauri/icons/tray-default-icon-instant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/desktop/src-tauri/icons/tray-default-icon-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/desktop/src-tauri/icons/tray-default-icon-studio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/desktop/src-tauri/icons/tray-stop-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions apps/desktop/src-tauri/src/tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ pub fn update_tray_icon_for_mode(app: &AppHandle, mode: RecordingMode) {

if let Ok(icon) = Image::from_bytes(get_mode_icon(mode)) {
let _ = tray.set_icon(Some(icon));
let _ = tray.set_icon_as_template(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we gate template mode to macOS for consistency with .icon_as_template(cfg!(target_os = "macos"))? If set_icon_as_template(true) isn’t a no-op on Linux, it could affect icon colors.

Suggested change
let _ = tray.set_icon_as_template(true);
let _ = tray.set_icon_as_template(cfg!(target_os = "macos"));

}
}

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

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

if let Ok(icon) = Image::from_bytes(include_bytes!("../icons/tray-stop-icon.png")) {
let _ = tray.set_icon(Some(icon));
let _ = tray.set_icon_as_template(true);
}
}
});
Expand All @@ -908,6 +911,7 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> {
let current_mode = get_current_mode(&app_handle);
if let Ok(icon) = Image::from_bytes(get_mode_icon(current_mode)) {
let _ = tray.set_icon(Some(icon));
let _ = tray.set_icon_as_template(true);
}
}
});
Expand Down