Quellcode durchsuchen

fix(core): `system-tray` cargo feature usage, fixes #1798 (#1801)

Lucas Fernandes Nogueira vor 4 Jahren
Ursprung
Commit
1ab8dd93e6

+ 6 - 0
.changes/system-tray-usage-fix.md

@@ -0,0 +1,6 @@
+---
+"tauri-runtime": patch
+"tauri-runtime-wry": patch
+---
+
+Fixes `system-tray` feature usage.

+ 2 - 2
core/tauri-runtime-wry/Cargo.toml

@@ -20,5 +20,5 @@ uuid = { version = "0.8.2", features = [ "v4" ] }
 
 [features]
 dox = [ "wry/dox" ]
-menu = [ "wry/menu" ]
-system-tray = [ "wry/tray" ]
+menu = [ "wry/menu", "tauri-runtime/menu" ]
+system-tray = [ "wry/tray", "tauri-runtime/system-tray" ]

+ 2 - 2
core/tauri-runtime/src/lib.rs

@@ -51,8 +51,8 @@ pub enum Error {
   #[error("JSON error: {0}")]
   Json(#[from] serde_json::Error),
   /// Encountered an error creating the app system tray.
-  #[cfg(feature = "menu")]
-  #[cfg_attr(doc_cfg, doc(cfg(feature = "menu")))]
+  #[cfg(feature = "system-tray")]
+  #[cfg_attr(doc_cfg, doc(cfg(feature = "system-tray")))]
   #[error("error encountered during tray setup: {0}")]
   SystemTray(Box<dyn std::error::Error + Send>),
   /// Failed to load window icon.