feature/share-libs
rs 28 lines 836 Bytes
Raw
1 use tauri::{AppHandle, WindowBuilder, WindowUrl};
2
3 #[tauri::command]
4 pub async fn open_lyrics_editor(handle: AppHandle, path: String) {
5 let url = format!("http://localhost:3002{}", path);
6 let docs_window = WindowBuilder::new(
7 &handle,
8 "lyrics_editor", /* the unique window label */
9 WindowUrl::App(url.parse().unwrap()),
10 )
11 .build()
12 .unwrap();
13 let _ = docs_window.set_title("Lyrics Editor");
14 }
15
16 #[tauri::command]
17 pub async fn open_player(handle: AppHandle, path: String) {
18 print!("{path}");
19 let url = format!("http://localhost:3002{}", path);
20 let docs_window = WindowBuilder::new(
21 &handle,
22 "page_search", /* the unique window label */
23 WindowUrl::App(url.parse().unwrap()),
24 )
25 .build()
26 .unwrap();
27 let _ = docs_window.set_title("Search");
28 }