@@ -9,7 +9,7 @@ use tauri_runtime::{
99 Request as HttpRequest , RequestParts as HttpRequestParts , Response as HttpResponse ,
1010 ResponseParts as HttpResponseParts ,
1111 } ,
12- menu:: { CustomMenuItem , Menu , MenuEntry , MenuHash , MenuId , MenuItem , MenuUpdate } ,
12+ menu:: { AboutMetadata , CustomMenuItem , Menu , MenuEntry , MenuHash , MenuId , MenuItem , MenuUpdate } ,
1313 monitor:: Monitor ,
1414 webview:: { WebviewIpcHandler , WindowBuilder , WindowBuilderBase } ,
1515 window:: {
@@ -55,8 +55,9 @@ use wry::{
5555 } ,
5656 global_shortcut:: { GlobalShortcut , ShortcutManager as WryShortcutManager } ,
5757 menu:: {
58- CustomMenuItem as WryCustomMenuItem , MenuBar , MenuId as WryMenuId , MenuItem as WryMenuItem ,
59- MenuItemAttributes as WryMenuItemAttributes , MenuType ,
58+ AboutMetadata as WryAboutMetadata , CustomMenuItem as WryCustomMenuItem , MenuBar ,
59+ MenuId as WryMenuId , MenuItem as WryMenuItem , MenuItemAttributes as WryMenuItemAttributes ,
60+ MenuType ,
6061 } ,
6162 monitor:: MonitorHandle ,
6263 window:: { Fullscreen , Icon as WryWindowIcon , UserAttentionType as WryUserAttentionType } ,
@@ -331,12 +332,31 @@ impl<'a> From<&'a CustomMenuItem> for MenuItemAttributesWrapper<'a> {
331332 }
332333}
333334
335+ pub struct AboutMetadataWrapper ( pub WryAboutMetadata ) ;
336+
337+ impl From < AboutMetadata > for AboutMetadataWrapper {
338+ fn from ( metadata : AboutMetadata ) -> Self {
339+ Self ( WryAboutMetadata {
340+ version : metadata. version ,
341+ authors : metadata. authors ,
342+ comments : metadata. comments ,
343+ copyright : metadata. copyright ,
344+ license : metadata. license ,
345+ website : metadata. website ,
346+ website_label : metadata. website_label ,
347+ } )
348+ }
349+ }
350+
334351pub struct MenuItemWrapper ( pub WryMenuItem ) ;
335352
336353impl From < MenuItem > for MenuItemWrapper {
337354 fn from ( item : MenuItem ) -> Self {
338355 match item {
339- MenuItem :: About ( v) => Self ( WryMenuItem :: About ( v) ) ,
356+ MenuItem :: About ( name, metadata) => Self ( WryMenuItem :: About (
357+ name,
358+ AboutMetadataWrapper :: from ( metadata) . 0 ,
359+ ) ) ,
340360 MenuItem :: Hide => Self ( WryMenuItem :: Hide ) ,
341361 MenuItem :: Services => Self ( WryMenuItem :: Services ) ,
342362 MenuItem :: HideOthers => Self ( WryMenuItem :: HideOthers ) ,
@@ -1979,7 +1999,7 @@ fn handle_user_message<T: UserEvent>(
19791999 #[ cfg( any( debug_assertions, feature = "devtools" ) ) ]
19802000 WindowMessage :: OpenDevTools => {
19812001 if let WindowHandle :: Webview ( w) = & webview. inner {
1982- w. devtool ( ) ;
2002+ w. open_devtools ( ) ;
19832003 }
19842004 }
19852005 // Getters
@@ -2731,7 +2751,7 @@ fn create_webview<T: UserEvent>(
27312751
27322752 #[ cfg( any( debug_assertions, feature = "devtools" ) ) ]
27332753 {
2734- webview_builder = webview_builder. with_dev_tool ( true ) ;
2754+ webview_builder = webview_builder. with_devtools ( true ) ;
27352755 }
27362756
27372757 let webview = webview_builder
@@ -2743,36 +2763,35 @@ fn create_webview<T: UserEvent>(
27432763
27442764 #[ cfg( windows) ]
27452765 {
2746- if let Some ( controller) = webview. controller ( ) {
2747- let proxy_ = proxy. clone ( ) ;
2748- let mut token = EventRegistrationToken :: default ( ) ;
2749- unsafe {
2750- controller. GotFocus (
2751- FocusChangedEventHandler :: create ( Box :: new ( move |_, _| {
2752- let _ = proxy_. send_event ( Message :: Webview (
2753- window_id,
2754- WebviewMessage :: WebviewEvent ( WebviewEvent :: Focused ( true ) ) ,
2755- ) ) ;
2756- Ok ( ( ) )
2757- } ) ) ,
2758- & mut token,
2759- )
2760- }
2761- . unwrap ( ) ;
2762- unsafe {
2763- controller. LostFocus (
2764- FocusChangedEventHandler :: create ( Box :: new ( move |_, _| {
2765- let _ = proxy. send_event ( Message :: Webview (
2766- window_id,
2767- WebviewMessage :: WebviewEvent ( WebviewEvent :: Focused ( false ) ) ,
2768- ) ) ;
2769- Ok ( ( ) )
2770- } ) ) ,
2771- & mut token,
2772- )
2773- }
2774- . unwrap ( ) ;
2766+ let controller = webview. controller ( ) ;
2767+ let proxy_ = proxy. clone ( ) ;
2768+ let mut token = EventRegistrationToken :: default ( ) ;
2769+ unsafe {
2770+ controller. GotFocus (
2771+ FocusChangedEventHandler :: create ( Box :: new ( move |_, _| {
2772+ let _ = proxy_. send_event ( Message :: Webview (
2773+ window_id,
2774+ WebviewMessage :: WebviewEvent ( WebviewEvent :: Focused ( true ) ) ,
2775+ ) ) ;
2776+ Ok ( ( ) )
2777+ } ) ) ,
2778+ & mut token,
2779+ )
2780+ }
2781+ . unwrap ( ) ;
2782+ unsafe {
2783+ controller. LostFocus (
2784+ FocusChangedEventHandler :: create ( Box :: new ( move |_, _| {
2785+ let _ = proxy. send_event ( Message :: Webview (
2786+ window_id,
2787+ WebviewMessage :: WebviewEvent ( WebviewEvent :: Focused ( false ) ) ,
2788+ ) ) ;
2789+ Ok ( ( ) )
2790+ } ) ) ,
2791+ & mut token,
2792+ )
27752793 }
2794+ . unwrap ( ) ;
27762795 }
27772796
27782797 Ok ( WindowWrapper {
0 commit comments