Skip to content

Commit 2911127

Browse files
authored
fix: update icon usage in tray guide, closes tauri-apps#796 (tauri-apps#870)
* fix: update icon usage in tray guide, closes tauri-apps#796 * Update docs/guides/features/system-tray.md
1 parent 5def810 commit 2911127

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/guides/features/system-tray.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ fn main() {
187187

188188
#### Updating tray icon
189189

190-
Note that `tauri::Icon` must be a `Path` variant on Linux, and `Raw` variant on Windows and macOS.
190+
Note that you need to add `icon-ico` or `icon-png` feature flag to the tauri dependency in your Cargo.toml in order to be able to use `Icon::Raw`
191191

192192
```rust
193-
app.tray_handle().set_icon(tauri::Icon::Raw(include_bytes!("../path/to/myicon.ico"))).unwrap();
193+
app.tray_handle().set_icon(tauri::Icon::Raw(include_bytes!("../path/to/myicon.ico").to_vec())).unwrap();
194194
```
195195

196196
[template image]: https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc

0 commit comments

Comments
 (0)