You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Support [macOS tray icon template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc) to adjust automatically based on taskbar color.
8
+
9
+
- Images you mark as template images should consist of only black and clear colors. You can use the alpha channel in the image to adjust the opacity of black content, however.
Copy file name to clipboardExpand all lines: core/tauri-utils/src/config.rs
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -209,6 +209,9 @@ pub struct SystemTrayConfig {
209
209
/// Path to the icon to use on the system tray.
210
210
/// Automatically set to be an `.png` on macOS and Linux, and `.ico` on Windows.
211
211
pubicon_path:PathBuf,
212
+
/// A Boolean value that determines whether the image represents a [template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc) image on macOS.
/// Support [macOS tray icon template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc) to adjust automatically based on taskbar color.
Copy file name to clipboardExpand all lines: docs/usage/guides/visual/system-tray.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,14 +12,18 @@ Configure the `systemTray` object on `tauri.conf.json`:
12
12
{
13
13
"tauri": {
14
14
"systemTray": {
15
-
"iconPath": "icons/icon.png"
15
+
"iconPath": "icons/icon.png",
16
+
"iconAsTemplate": true,
16
17
}
17
18
}
18
19
}
19
20
```
20
21
21
22
The `iconPath` is pointed to a PNG file on macOS and Linux, and a `.ico` file must exist for Windows support.
22
23
24
+
The `iconAsTemplate` is a boolean value that determines whether the image represents a [template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc) image on macOS.
25
+
26
+
23
27
### Creating a system tray
24
28
25
29
To create a native system tray, import the `SystemTray` type:
0 commit comments