feat: 补齐桌面端下载播放,并将窗口改为夜间主题和应用图标
@@ -2710,6 +2710,8 @@ dependencies = [
|
||||
"tauri",
|
||||
"tauri-build",
|
||||
"tauri-plugin-opener",
|
||||
"webview2-com",
|
||||
"windows-core 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -20,6 +20,10 @@ tauri-build = { version = "2", features = [] }
|
||||
[dependencies]
|
||||
tauri = { version = "2", features = [] }
|
||||
tauri-plugin-opener = "2"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
webview2-com = "0.38"
|
||||
windows-core = "0.61"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
"identifier": "default",
|
||||
"description": "Capability for the main window",
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"permissions": [
|
||||
"core:default",
|
||||
"core:window:allow-destroy",
|
||||
"opener:default"
|
||||
]
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1020 B After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 848 B After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#fff</color>
|
||||
</resources>
|
||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 951 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 424 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
@@ -2,7 +2,7 @@
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>RaptDrama</title>
|
||||
<title>RaptDrama Download Tools</title>
|
||||
<style>
|
||||
html, body { height: 100%; margin: 0; background: #101014; color: #f2f2f2; font: 16px/1.5 "Segoe UI", sans-serif; }
|
||||
body { display: flex; align-items: center; justify-content: center; }
|
||||
|
||||
@@ -121,6 +121,32 @@ fn stop_child(handle: &AppHandle) {
|
||||
}
|
||||
}
|
||||
|
||||
fn disable_browser_chrome(window: &tauri::WebviewWindow) {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use webview2_com::Microsoft::Web::WebView2::Win32::ICoreWebView2Settings3;
|
||||
use windows_core::Interface;
|
||||
let _ = window.with_webview(|webview| unsafe {
|
||||
let Ok(core) = webview.controller().CoreWebView2() else {
|
||||
return;
|
||||
};
|
||||
let Ok(settings) = core.Settings() else {
|
||||
return;
|
||||
};
|
||||
let _ = settings.SetAreDefaultContextMenusEnabled(false);
|
||||
let _ = settings.SetAreDevToolsEnabled(false);
|
||||
let _ = settings.SetIsStatusBarEnabled(false);
|
||||
if let Ok(settings3) = settings.cast::<ICoreWebView2Settings3>() {
|
||||
let _ = settings3.SetAreBrowserAcceleratorKeysEnabled(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
let _ = window;
|
||||
}
|
||||
}
|
||||
|
||||
fn boot(handle: &AppHandle, window: &tauri::WebviewWindow) -> Result<(), String> {
|
||||
let root = repo_root();
|
||||
let mut last_error = "后台启动超时".to_string();
|
||||
@@ -163,6 +189,7 @@ pub fn run() {
|
||||
let window = handle
|
||||
.get_webview_window("main")
|
||||
.expect("主窗口");
|
||||
disable_browser_chrome(&window);
|
||||
std::thread::spawn(move || {
|
||||
if let Err(message) = boot(&handle, &window) {
|
||||
eprintln!("后台启动失败:{message}");
|
||||
|
||||
@@ -19,9 +19,15 @@
|
||||
"windows": [
|
||||
{
|
||||
"label": "main",
|
||||
"title": "RaptDrama",
|
||||
"width": 800,
|
||||
"height": 600
|
||||
"title": "RaptDrama Download Tools",
|
||||
"width": 1280,
|
||||
"height": 800,
|
||||
"minWidth": 1024,
|
||||
"minHeight": 680,
|
||||
"center": true,
|
||||
"theme": "Dark",
|
||||
"backgroundColor": "#101014",
|
||||
"devtools": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
|
||||