mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-11 17:29:44 +00:00
refactor: remove platform-specific tauri conf
Merge windows back to main tauri config. The reason I separated them was because I need decoration: true on mac and false on windows and linux. Now I use tauri rust API to set decorations to false for win and linux.
This commit is contained in:
parent
df1213e87a
commit
656100cb76
@ -55,11 +55,17 @@ impl<R: Runtime> WindowExt for WebviewWindow<R> {
|
|||||||
pub fn setup_window<R: Runtime>(app: &AppHandle<R>) {
|
pub fn setup_window<R: Runtime>(app: &AppHandle<R>) {
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
{
|
{
|
||||||
app.get_webview_window("main")
|
let main_win = app.get_webview_window("main").unwrap();
|
||||||
.unwrap()
|
main_win.set_transparent_titlebar(true, true);
|
||||||
.set_transparent_titlebar(true, true);
|
let splashscreen_win = app.get_webview_window("splashscreen").unwrap();
|
||||||
app.get_webview_window("splashscreen")
|
splashscreen_win.set_transparent_titlebar(true, true);
|
||||||
.unwrap()
|
}
|
||||||
.set_transparent_titlebar(true, true);
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
{
|
||||||
|
// on linux or windows, set decorations to false
|
||||||
|
let main_win = app.get_webview_window("main").unwrap();
|
||||||
|
main_win
|
||||||
|
.set_decorations(false)
|
||||||
|
.expect("Failed to set decorations");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,23 @@
|
|||||||
"macOSPrivateApi": true,
|
"macOSPrivateApi": true,
|
||||||
"security": {
|
"security": {
|
||||||
"csp": null
|
"csp": null
|
||||||
}
|
},
|
||||||
|
"windows": [
|
||||||
|
{
|
||||||
|
"hiddenTitle": true,
|
||||||
|
"url": "/app",
|
||||||
|
"title": "Kunkun",
|
||||||
|
"width": 800,
|
||||||
|
"visible": false,
|
||||||
|
"height": 600,
|
||||||
|
"decorations": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "/splashscreen",
|
||||||
|
"visible": false,
|
||||||
|
"label": "splashscreen"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"createUpdaterArtifacts": true,
|
"createUpdaterArtifacts": true,
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"identifier": "sh.kunkun.desktop",
|
|
||||||
"app": {
|
|
||||||
"windows": [
|
|
||||||
{
|
|
||||||
"hiddenTitle": true,
|
|
||||||
"url": "/app",
|
|
||||||
"title": "Kunkun",
|
|
||||||
"width": 800,
|
|
||||||
"height": 600,
|
|
||||||
"visible": false,
|
|
||||||
"decorations": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "/splashscreen",
|
|
||||||
"label": "splashscreen",
|
|
||||||
"visible": false,
|
|
||||||
"decorations": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"identifier": "sh.kunkun.desktop",
|
|
||||||
"app": {
|
|
||||||
"windows": [
|
|
||||||
{
|
|
||||||
"hiddenTitle": true,
|
|
||||||
"url": "/app",
|
|
||||||
"title": "Kunkun",
|
|
||||||
"width": 800,
|
|
||||||
"visible": false,
|
|
||||||
"height": 600
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "/splashscreen",
|
|
||||||
"visible": false,
|
|
||||||
"label": "splashscreen"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"identifier": "sh.kunkun.desktop",
|
|
||||||
"app": {
|
|
||||||
"windows": [
|
|
||||||
{
|
|
||||||
"hiddenTitle": true,
|
|
||||||
"url": "/app",
|
|
||||||
"title": "Kunkun",
|
|
||||||
"width": 800,
|
|
||||||
"height": 600,
|
|
||||||
"visible": false,
|
|
||||||
"decorations": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "/splashscreen",
|
|
||||||
"label": "splashscreen",
|
|
||||||
"visible": false,
|
|
||||||
"decorations": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user