@@ -29,19 +29,20 @@ fn create_window<R: Runtime>(app: &tauri::AppHandle<R>, label: String, path: Str
2929 . center ( )
3030 . resizable ( true )
3131 . visible ( false )
32- . decorations ( true ) ;
32+ . decorations ( false ) ;
3333 #[ cfg( target_os = "macos" ) ]
3434 {
3535 builder
3636 . hidden_title ( true )
3737 . title_bar_style ( tauri:: TitleBarStyle :: Overlay )
38+ . decorations ( true )
3839 . build ( )
3940 . unwrap ( ) ;
4041 }
4142
4243 #[ cfg( not( target_os = "macos" ) ) ]
4344 {
44- builder. decorations ( true ) . build ( ) . unwrap ( ) ;
45+ builder. decorations ( false ) . build ( ) . unwrap ( ) ;
4546 }
4647}
4748
@@ -81,8 +82,12 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
8182 _ => { }
8283 } )
8384 . tooltip ( "MDX editor" )
85+ . icon ( if cfg ! ( target_os = "macos" ) {
86+ Image :: from_bytes ( include_bytes ! ( "../icons/appleTrayIcon.png" ) )
87+ } else {
88+ Image :: from_bytes ( include_bytes ! ( "../icons/128x128.png" ) )
89+ } ?)
8490 . icon_as_template ( true )
85- . icon ( Image :: from_path ( "icons/social-square.png" ) ?)
8691 . on_tray_icon_event ( |tray, event| match event {
8792 TrayIconEvent :: Click {
8893 id : _,
@@ -92,15 +97,6 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
9297 button_state : _,
9398 } => match button {
9499 MouseButton :: Left { } => {
95- // let windows = tray.app_handle().webview_windows();
96- // for (key, value) in windows {
97- // if key == "login" || key == "main" {
98- // value.show().unwrap();
99- // value.unminimize().unwrap();
100- // value.set_focus().unwrap();
101- // }
102- // }
103-
104100 tray. app_handle ( ) . emit ( "tray_menu" , position) . unwrap ( ) ;
105101 }
106102 MouseButton :: Right { } => { }
0 commit comments