Skip to content

Commit 8a71858

Browse files
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>
1 parent bf2635a commit 8a71858

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

.changes/default-generic-for-menu.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri': patch:enhance
3+
---
4+
5+
Provide a default for the runtime generic on `Menu`, `MenuItem`, `Submenu`, `PredefinedMenuItem`, `CheckMenuItem` and `IconMenuItem`.

.changes/default-generic-for-tray.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri': patch:enhance
3+
---
4+
5+
Provide a default for the runtime generic on `TrayIcon`.

core/tauri/src/menu/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ macro_rules! gen_wrappers {
7070
),*
7171
) => {
7272
$(
73+
#[tauri_macros::default_runtime(crate::Wry, wry)]
7374
pub(crate) struct $inner<R: $crate::Runtime> {
7475
id: $crate::menu::MenuId,
7576
inner: ::std::option::Option<::muda::$type>,

core/tauri/src/tray/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ impl<R: Runtime> TrayIconBuilder<R> {
243243
/// This type is reference-counted and the icon is removed when the last instance is dropped.
244244
///
245245
/// See [TrayIconBuilder] to construct this type.
246+
#[tauri_macros::default_runtime(crate::Wry, wry)]
246247
pub struct TrayIcon<R: Runtime> {
247248
id: TrayIconId,
248249
inner: tray_icon::TrayIcon,

0 commit comments

Comments
 (0)