File tree Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 4
4
) ]
5
5
6
6
use std:: path:: Path ;
7
+ use tauri:: Manager ;
7
8
8
9
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
9
10
#[ tauri:: command]
@@ -17,9 +18,19 @@ fn path_exists(path: &str) -> bool {
17
18
path. exists ( )
18
19
}
19
20
21
+ #[ tauri:: command]
22
+ async fn show_main_window ( window : tauri:: Window ) {
23
+ // Show main window
24
+ window. get_window ( "main" ) . unwrap ( ) . show ( ) . unwrap ( ) ;
25
+ }
26
+
20
27
fn main ( ) {
21
28
tauri:: Builder :: default ( )
22
- . invoke_handler ( tauri:: generate_handler![ greet, path_exists] )
29
+ . invoke_handler ( tauri:: generate_handler![
30
+ greet,
31
+ path_exists,
32
+ show_main_window
33
+ ] )
23
34
. run ( tauri:: generate_context!( ) )
24
35
. expect ( "error while running tauri application" ) ;
25
36
}
Original file line number Diff line number Diff line change 7
7
},
8
8
"package" : {
9
9
"productName" : " Dropcode" ,
10
- "version" : " 0.0.2 "
10
+ "version" : " 0.0.3 "
11
11
},
12
12
"tauri" : {
13
13
"allowlist" : {
63
63
"title" : " Dropcode" ,
64
64
"width" : 800 ,
65
65
"minWidth" : 800 ,
66
- "minHeight" : 600
66
+ "minHeight" : 600 ,
67
+ "visible" : false
67
68
}
68
69
]
69
70
}
Original file line number Diff line number Diff line change 1
1
import { Route , Routes } from "@solidjs/router"
2
+ import { invoke } from "@tauri-apps/api"
2
3
import { onMount , Show } from "solid-js"
3
4
import { Home } from "../screens/Home"
4
5
import { Snippets } from "../screens/Snippets"
5
6
import { actions , state } from "../store"
6
7
7
8
export const App = ( ) => {
8
9
onMount ( ( ) => {
10
+ invoke ( "show_main_window" )
11
+
9
12
actions . init ( )
10
13
} )
11
14
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export const Home = () => {
21
21
< div class = "h-screen flex items-center justify-center" >
22
22
< button
23
23
onClick = { openFolder }
24
- class = "cursor border rounded-lg shadow-sm h-10 px-3 active:bg-zinc-100"
24
+ class = "cursor border rounded-lg shadow-sm h-10 px-3 active:bg-zinc-100 dark:active:bg-zinc-700 "
25
25
>
26
26
Open Folder
27
27
</ button >
You can’t perform that action at this time.
0 commit comments