File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " tauri " : ' minor:enhance'
3+ ---
4+
5+ Introduce ` with_inner_tray_icon ` for Tauri ` TrayIcon ` to access the inner platform-specific tray icon.
6+
7+ Note that ` tray-icon ` crate may be updated in minor releases of Tauri.
8+ Therefore, it’s recommended to pin Tauri to at least a minor version when you’re using ` with_inner_tray_icon ` .
Original file line number Diff line number Diff line change @@ -603,6 +603,18 @@ impl<R: Runtime> TrayIcon<R> {
603603 } )
604604 } )
605605 }
606+
607+ /// Do something with the inner [`tray_icon::TrayIcon`] on main thread
608+ ///
609+ /// Note that `tray-icon` crate may be updated in minor releases of Tauri.
610+ /// Therefore, it’s recommended to pin Tauri to at least a minor version when you’re using `with_inner_tray_icon`.
611+ pub fn with_inner_tray_icon < F , T > ( & self , f : F ) -> crate :: Result < T >
612+ where
613+ F : FnOnce ( & tray_icon:: TrayIcon ) -> T + Send + ' static ,
614+ T : Send + ' static ,
615+ {
616+ run_item_main_thread ! ( self , |self_: Self | { f( & self_. inner) } )
617+ }
606618}
607619
608620impl < R : Runtime > Resource for TrayIcon < R > {
You can’t perform that action at this time.
0 commit comments