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>
This commit is contained in:
Oscar Beaumont
2024-05-02 05:44:15 +08:00
committed by GitHub
parent bf2635ab62
commit 8a71858eb2
4 changed files with 12 additions and 0 deletions

View File

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

View File

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

View File

@@ -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>,

View File

@@ -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,