Archived
Remove custom window design, just use native system design again
This commit is contained in:
8 files changed
+17
-136
No files matched your search
@@ -19,12 +19,11 @@ tauri-plugin-fs = "2.4.5"
|
|||||||
tokio = "1.49.0"
|
tokio = "1.49.0"
|
||||||
zip = "8.1.0"
|
zip = "8.1.0"
|
||||||
tauri-plugin-os = "2.3.2"
|
tauri-plugin-os = "2.3.2"
|
||||||
reqwest = { version = "0.13.2", default-features = false, features = ["stream", "rustls"] }
|
reqwest = { version = "0.13.2", default-features = false, features = ["stream", "native-tls"] }
|
||||||
tauri-plugin-opener = "2.5.3"
|
tauri-plugin-opener = "2.5.3"
|
||||||
tauri-plugin-dialog = "2.6.0"
|
tauri-plugin-dialog = "2.6.0"
|
||||||
sha2 = "0.10.9"
|
sha2 = "0.10.9"
|
||||||
tauri-plugin-decorum = "1.1.1"
|
tauri-plugin-prevent-default = "4.0.4"
|
||||||
tauri-plugin-prevent-default = "4.0.3"
|
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||||
tauri-plugin-single-instance = "2.4.0"
|
tauri-plugin-single-instance = "2.4.0"
|
||||||
|
|||||||
@@ -7,16 +7,7 @@
|
|||||||
],
|
],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"core:default",
|
"core:default",
|
||||||
"core:window:allow-close",
|
|
||||||
"core:window:allow-center",
|
|
||||||
"core:window:allow-minimize",
|
|
||||||
"core:window:allow-maximize",
|
|
||||||
"core:window:allow-set-size",
|
|
||||||
"core:window:allow-set-focus",
|
|
||||||
"core:window:allow-is-maximized",
|
|
||||||
"core:window:allow-start-dragging",
|
"core:window:allow-start-dragging",
|
||||||
"core:window:allow-toggle-maximize",
|
|
||||||
"decorum:allow-show-snap-overlay",
|
|
||||||
"fs:default",
|
"fs:default",
|
||||||
"os:default",
|
"os:default",
|
||||||
"opener:default",
|
"opener:default",
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ use tauri_plugin_os::platform;
|
|||||||
use tauri_plugin_prevent_default::Flags;
|
use tauri_plugin_prevent_default::Flags;
|
||||||
use zip::ZipArchive;
|
use zip::ZipArchive;
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
|
||||||
use tauri_plugin_decorum::WebviewWindowExt;
|
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
|
|
||||||
@@ -183,18 +180,8 @@ pub fn run() {
|
|||||||
.plugin(tauri_plugin_dialog::init())
|
.plugin(tauri_plugin_dialog::init())
|
||||||
.plugin(tauri_plugin_opener::init())
|
.plugin(tauri_plugin_opener::init())
|
||||||
.plugin(tauri_plugin_fs::init())
|
.plugin(tauri_plugin_fs::init())
|
||||||
.plugin(tauri_plugin_decorum::init())
|
|
||||||
.plugin(tauri_plugin_os::init())
|
.plugin(tauri_plugin_os::init())
|
||||||
.setup(|app| {
|
.setup(|app| {
|
||||||
#[cfg(target_os = "windows")]
|
|
||||||
{
|
|
||||||
if let Some(main_window) = app.get_webview_window("main") {
|
|
||||||
if let Err(e) = main_window.create_overlay_titlebar() {
|
|
||||||
eprintln!("Failed to create overlay titlebar: {:?}", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let app_local_data_dir = match app.path().app_local_data_dir() {
|
let app_local_data_dir = match app.path().app_local_data_dir() {
|
||||||
Ok(p) => p,
|
Ok(p) => p,
|
||||||
Err(_) => return Ok(()),
|
Err(_) => return Ok(()),
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"withGlobalTauri": true,
|
"withGlobalTauri": true,
|
||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
|
"title": "Lncvrt Games Launcher",
|
||||||
"width": 300,
|
"width": 300,
|
||||||
"height": 300,
|
"height": 300,
|
||||||
"resizable": false,
|
"resizable": false,
|
||||||
@@ -24,6 +25,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"active": false
|
"active": true,
|
||||||
|
"targets": ["deb", "rpm", "dmg", "msi"],
|
||||||
|
"macOS": {
|
||||||
|
"minimumSystemVersion": "13.0"
|
||||||
|
},
|
||||||
|
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
|
||||||
"productName": "Lncvrt Games Launcher",
|
|
||||||
"version": "1.1.0",
|
|
||||||
"identifier": "xyz.lncvrt.lncvrt-games-launcher-loader",
|
|
||||||
"build": {
|
|
||||||
"beforeDevCommand": "bun run dev",
|
|
||||||
"devUrl": "http://localhost:5173",
|
|
||||||
"beforeBuildCommand": "bun run build",
|
|
||||||
"frontendDist": "../dist"
|
|
||||||
},
|
|
||||||
"app": {
|
|
||||||
"withGlobalTauri": true,
|
|
||||||
"windows": [
|
|
||||||
{
|
|
||||||
"title": "Lncvrt Games Launcher",
|
|
||||||
"width": 300,
|
|
||||||
"height": 300,
|
|
||||||
"resizable": false,
|
|
||||||
"maximizable": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"security": {
|
|
||||||
"csp": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bundle": {
|
|
||||||
"active": true,
|
|
||||||
"targets": ["deb", "rpm"],
|
|
||||||
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
|
||||||
"productName": "Lncvrt Games Launcher",
|
|
||||||
"version": "1.1.0",
|
|
||||||
"identifier": "xyz.lncvrt.lncvrt-games-launcher-loader",
|
|
||||||
"build": {
|
|
||||||
"beforeDevCommand": "bun run dev",
|
|
||||||
"devUrl": "http://localhost:5173",
|
|
||||||
"beforeBuildCommand": "bun run build",
|
|
||||||
"frontendDist": "../dist"
|
|
||||||
},
|
|
||||||
"app": {
|
|
||||||
"withGlobalTauri": true,
|
|
||||||
"windows": [
|
|
||||||
{
|
|
||||||
"width": 300,
|
|
||||||
"height": 300,
|
|
||||||
"resizable": false,
|
|
||||||
"maximizable": false,
|
|
||||||
"titleBarStyle": "Overlay",
|
|
||||||
"hiddenTitle": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"security": {
|
|
||||||
"csp": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bundle": {
|
|
||||||
"active": true,
|
|
||||||
"targets": ["dmg"],
|
|
||||||
"macOS": {
|
|
||||||
"minimumSystemVersion": "13.0"
|
|
||||||
},
|
|
||||||
"icon": ["icons/icon.icns"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
|
||||||
"productName": "Lncvrt Games Launcher",
|
|
||||||
"version": "1.1.0",
|
|
||||||
"identifier": "xyz.lncvrt.lncvrt-games-launcher-loader",
|
|
||||||
"build": {
|
|
||||||
"beforeDevCommand": "bun run dev",
|
|
||||||
"devUrl": "http://localhost:5173",
|
|
||||||
"beforeBuildCommand": "bun run build",
|
|
||||||
"frontendDist": "../dist"
|
|
||||||
},
|
|
||||||
"app": {
|
|
||||||
"withGlobalTauri": true,
|
|
||||||
"windows": [
|
|
||||||
{
|
|
||||||
"title": "Lncvrt Games Launcher",
|
|
||||||
"width": 300,
|
|
||||||
"height": 332,
|
|
||||||
"resizable": false,
|
|
||||||
"maximizable": false,
|
|
||||||
"titleBarStyle": "Overlay",
|
|
||||||
"hiddenTitle": true,
|
|
||||||
"decorations": false,
|
|
||||||
"shadow": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"security": {
|
|
||||||
"csp": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bundle": {
|
|
||||||
"active": true,
|
|
||||||
"targets": "msi",
|
|
||||||
"icon": ["icons/icon.ico"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+8
-6
@@ -17,6 +17,7 @@ import { message } from '@tauri-apps/plugin-dialog'
|
|||||||
|
|
||||||
import '@fontsource/lexend'
|
import '@fontsource/lexend'
|
||||||
import './App.css'
|
import './App.css'
|
||||||
|
import { getCurrentWindow } from '@tauri-apps/api/window'
|
||||||
|
|
||||||
interface LauncherUpdate {
|
interface LauncherUpdate {
|
||||||
id: string
|
id: string
|
||||||
@@ -117,12 +118,13 @@ export default function App () {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div
|
||||||
|
className='w-screen h-screen'
|
||||||
|
onMouseDown={() => getCurrentWindow().startDragging()}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className='relative z-2 w-screen border-b border-b-(--col3) h-8.25 bg-(--col1)'
|
className={`absolute left-1/2 top-10 -translate-x-1/2 flex flex-col items-center`}
|
||||||
hidden={platform() != 'windows'}
|
>
|
||||||
/>
|
|
||||||
<div className={`absolute left-1/2 ${platform() == 'windows' ? 'top-18' : 'top-10'} -translate-x-1/2 flex flex-col items-center`}>
|
|
||||||
<img
|
<img
|
||||||
src='/Icon.png'
|
src='/Icon.png'
|
||||||
width={128}
|
width={128}
|
||||||
@@ -156,6 +158,6 @@ export default function App () {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user