@@ -109,7 +109,7 @@ impl From<tray_icon::TrayIconEvent> for TrayIconEvent {
109109#[ derive( Default ) ]
110110pub struct TrayIconBuilder < R : Runtime > {
111111 on_menu_event : Option < GlobalMenuEventListener < AppHandle < R > > > ,
112- on_tray_event : Option < GlobalTrayIconEventListener < TrayIcon < R > > > ,
112+ on_tray_icon_event : Option < GlobalTrayIconEventListener < TrayIcon < R > > > ,
113113 inner : tray_icon:: TrayIconBuilder ,
114114}
115115
@@ -124,7 +124,7 @@ impl<R: Runtime> TrayIconBuilder<R> {
124124 Self {
125125 inner : tray_icon:: TrayIconBuilder :: new ( ) ,
126126 on_menu_event : None ,
127- on_tray_event : None ,
127+ on_tray_icon_event : None ,
128128 }
129129 }
130130
@@ -223,11 +223,11 @@ impl<R: Runtime> TrayIconBuilder<R> {
223223 }
224224
225225 /// Set a handler for this tray icon events.
226- pub fn on_tray_event < F : Fn ( & TrayIcon < R > , TrayIconEvent ) + Sync + Send + ' static > (
226+ pub fn on_tray_icon_event < F : Fn ( & TrayIcon < R > , TrayIconEvent ) + Sync + Send + ' static > (
227227 mut self ,
228228 f : F ,
229229 ) -> Self {
230- self . on_tray_event . replace ( Box :: new ( f) ) ;
230+ self . on_tray_icon_event . replace ( Box :: new ( f) ) ;
231231 self
232232 }
233233
@@ -247,7 +247,11 @@ impl<R: Runtime> TrayIconBuilder<R> {
247247 app_handle : manager. app_handle ( ) . clone ( ) ,
248248 } ;
249249
250- icon. register ( & icon. app_handle , self . on_menu_event , self . on_tray_event ) ;
250+ icon. register (
251+ & icon. app_handle ,
252+ self . on_menu_event ,
253+ self . on_tray_icon_event ,
254+ ) ;
251255
252256 Ok ( icon)
253257 }
@@ -285,7 +289,7 @@ impl<R: Runtime> TrayIcon<R> {
285289 & self ,
286290 app_handle : & AppHandle < R > ,
287291 on_menu_event : Option < GlobalMenuEventListener < AppHandle < R > > > ,
288- on_tray_event : Option < GlobalTrayIconEventListener < TrayIcon < R > > > ,
292+ on_tray_icon_event : Option < GlobalTrayIconEventListener < TrayIcon < R > > > ,
289293 ) {
290294 if let Some ( handler) = on_menu_event {
291295 app_handle
@@ -297,7 +301,7 @@ impl<R: Runtime> TrayIcon<R> {
297301 . push ( handler) ;
298302 }
299303
300- if let Some ( handler) = on_tray_event {
304+ if let Some ( handler) = on_tray_icon_event {
301305 app_handle
302306 . manager
303307 . inner
@@ -337,7 +341,10 @@ impl<R: Runtime> TrayIcon<R> {
337341 }
338342
339343 /// Register a handler for this tray icon events.
340- pub fn on_tray_event < F : Fn ( & TrayIcon < R > , TrayIconEvent ) + Sync + Send + ' static > ( & self , f : F ) {
344+ pub fn on_tray_icon_event < F : Fn ( & TrayIcon < R > , TrayIconEvent ) + Sync + Send + ' static > (
345+ & self ,
346+ f : F ,
347+ ) {
341348 self
342349 . app_handle
343350 . manager
0 commit comments