mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
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:
5
.changes/default-generic-for-menu.md
Normal file
5
.changes/default-generic-for-menu.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri': patch:enhance
|
||||
---
|
||||
|
||||
Provide a default for the runtime generic on `Menu`, `MenuItem`, `Submenu`, `PredefinedMenuItem`, `CheckMenuItem` and `IconMenuItem`.
|
||||
5
.changes/default-generic-for-tray.md
Normal file
5
.changes/default-generic-for-tray.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri': patch:enhance
|
||||
---
|
||||
|
||||
Provide a default for the runtime generic on `TrayIcon`.
|
||||
@@ -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>,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user