Forráskód Böngészése

feat: configure a default runtime for menu and tray icon types (#9630)

* Use `tauri::Wry` as default runtime for menu types

* do it properly

* changes

* same for tray icon

* change file

---------

Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
Oscar Beaumont 1 éve
szülő
commit
8a71858eb2

+ 5 - 0
.changes/default-generic-for-menu.md

@@ -0,0 +1,5 @@
+---
+'tauri': patch:enhance
+---
+
+Provide a default for the runtime generic on `Menu`, `MenuItem`, `Submenu`, `PredefinedMenuItem`, `CheckMenuItem` and `IconMenuItem`.

+ 5 - 0
.changes/default-generic-for-tray.md

@@ -0,0 +1,5 @@
+---
+'tauri': patch:enhance
+---
+
+Provide a default for the runtime generic on `TrayIcon`.

+ 1 - 0
core/tauri/src/menu/mod.rs

@@ -70,6 +70,7 @@ macro_rules! gen_wrappers {
     ),*
   ) => {
     $(
+      #[tauri_macros::default_runtime(crate::Wry, wry)]
       pub(crate) struct $inner<R: $crate::Runtime> {
         id: $crate::menu::MenuId,
         inner: ::std::option::Option<::muda::$type>,

+ 1 - 0
core/tauri/src/tray/mod.rs

@@ -243,6 +243,7 @@ impl<R: Runtime> TrayIconBuilder<R> {
 /// This type is reference-counted and the icon is removed when the last instance is dropped.
 ///
 /// See [TrayIconBuilder] to construct this type.
+#[tauri_macros::default_runtime(crate::Wry, wry)]
 pub struct TrayIcon<R: Runtime> {
   id: TrayIconId,
   inner: tray_icon::TrayIcon,