💄 调整level UI

This commit is contained in:
目棃
2024-12-15 09:04:41 +08:00
parent 3f0115ecba
commit 07954d0c24
5 changed files with 178 additions and 174 deletions

68
src-tauri/Cargo.lock generated
View File

@@ -617,9 +617,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.2.3"
version = "1.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d"
checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf"
dependencies = [
"shlex",
]
@@ -3537,7 +3537,7 @@ dependencies = [
"rustc-hash",
"rustls",
"socket2",
"thiserror 2.0.6",
"thiserror 2.0.7",
"tokio",
"tracing",
]
@@ -3556,7 +3556,7 @@ dependencies = [
"rustls",
"rustls-pki-types",
"slab",
"thiserror 2.0.6",
"thiserror 2.0.7",
"tinyvec",
"tracing",
"web-time",
@@ -3958,9 +3958,9 @@ dependencies = [
[[package]]
name = "rustls-pki-types"
version = "1.10.0"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b"
checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37"
dependencies = [
"web-time",
]
@@ -4849,7 +4849,7 @@ dependencies = [
"tauri-runtime",
"tauri-runtime-wry",
"tauri-utils",
"thiserror 2.0.6",
"thiserror 2.0.7",
"tokio",
"tray-icon",
"url",
@@ -4902,7 +4902,7 @@ dependencies = [
"sha2",
"syn 2.0.90",
"tauri-utils",
"thiserror 2.0.6",
"thiserror 2.0.7",
"time",
"url",
"uuid",
@@ -4943,7 +4943,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-deep-link"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"dunce",
"rust-ini",
@@ -4952,7 +4952,7 @@ dependencies = [
"tauri",
"tauri-plugin",
"tauri-utils",
"thiserror 2.0.6",
"thiserror 2.0.7",
"tracing",
"url",
"windows-registry 0.3.0",
@@ -4962,7 +4962,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"log",
"raw-window-handle",
@@ -4972,14 +4972,14 @@ dependencies = [
"tauri",
"tauri-plugin",
"tauri-plugin-fs",
"thiserror 2.0.6",
"thiserror 2.0.7",
"url",
]
[[package]]
name = "tauri-plugin-fs"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"anyhow",
"dunce",
@@ -4992,7 +4992,7 @@ dependencies = [
"tauri",
"tauri-plugin",
"tauri-utils",
"thiserror 2.0.6",
"thiserror 2.0.7",
"toml 0.8.19",
"url",
"uuid",
@@ -5001,7 +5001,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-http"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"data-url",
"http",
@@ -5013,7 +5013,7 @@ dependencies = [
"tauri",
"tauri-plugin",
"tauri-plugin-fs",
"thiserror 2.0.6",
"thiserror 2.0.7",
"tokio",
"url",
"urlpattern",
@@ -5022,7 +5022,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-log"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"android_logger",
"byte-unit",
@@ -5036,14 +5036,14 @@ dependencies = [
"swift-rs",
"tauri",
"tauri-plugin",
"thiserror 2.0.6",
"thiserror 2.0.7",
"time",
]
[[package]]
name = "tauri-plugin-os"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"gethostname",
"log",
@@ -5054,13 +5054,13 @@ dependencies = [
"sys-locale",
"tauri",
"tauri-plugin",
"thiserror 2.0.6",
"thiserror 2.0.7",
]
[[package]]
name = "tauri-plugin-process"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"tauri",
"tauri-plugin",
@@ -5069,7 +5069,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-shell"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"encoding_rs",
"log",
@@ -5082,19 +5082,19 @@ dependencies = [
"shared_child",
"tauri",
"tauri-plugin",
"thiserror 2.0.6",
"thiserror 2.0.7",
"tokio",
]
[[package]]
name = "tauri-plugin-single-instance"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"serde",
"serde_json",
"tauri",
"thiserror 2.0.6",
"thiserror 2.0.7",
"tracing",
"windows-sys 0.59.0",
"zbus 4.4.0",
@@ -5103,7 +5103,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-sql"
version = "2.2.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#802399a969a95c1cdd9ce8076cd1f7cbdf6d1d9e"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#ee0f65de5c645c244c5f0b638e0e0aab687cb9bf"
dependencies = [
"futures-core",
"indexmap 2.7.0",
@@ -5113,7 +5113,7 @@ dependencies = [
"sqlx",
"tauri",
"tauri-plugin",
"thiserror 2.0.6",
"thiserror 2.0.7",
"time",
"tokio",
]
@@ -5132,7 +5132,7 @@ dependencies = [
"serde",
"serde_json",
"tauri-utils",
"thiserror 2.0.6",
"thiserror 2.0.7",
"url",
"windows",
]
@@ -5192,7 +5192,7 @@ dependencies = [
"serde_json",
"serde_with",
"swift-rs",
"thiserror 2.0.6",
"thiserror 2.0.7",
"toml 0.8.19",
"url",
"urlpattern",
@@ -5251,11 +5251,11 @@ dependencies = [
[[package]]
name = "thiserror"
version = "2.0.6"
version = "2.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47"
checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767"
dependencies = [
"thiserror-impl 2.0.6",
"thiserror-impl 2.0.7",
]
[[package]]
@@ -5271,9 +5271,9 @@ dependencies = [
[[package]]
name = "thiserror-impl"
version = "2.0.6"
version = "2.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312"
checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36"
dependencies = [
"proc-macro2",
"quote",

View File

@@ -1,6 +1,6 @@
//! @file src/client/mod.rs
//! @desc 客户端模块,负责操作米游社客户端
//! @since Beta v0.6.5
//! @since Beta v0.6.7
mod menu;
mod utils;
@@ -8,11 +8,13 @@ mod utils;
use tauri::{AppHandle, Manager, WebviewWindowBuilder};
use tauri_utils::config::WebviewUrl;
static BBS_VERSION: &'static str = "2.78.1";
#[tauri::command]
pub async fn create_mhy_client(handle: AppHandle, func: String, url: String) {
let mut win_width = 400.0;
let mut win_height = 800.0;
let win_ua = "Mozilla/5.0 (Linux; Android 12) Mobile miHoYoBBS/2.78.1";
let win_ua = format!("Mozilla/5.0 (Linux; Android 12) Mobile miHoYoBBS/{BBS_VERSION}");
let url_parse;
if url != "" {
url_parse = WebviewUrl::External(url.parse().unwrap());
@@ -36,7 +38,7 @@ pub async fn create_mhy_client(handle: AppHandle, func: String, url: String) {
.inner_size(trans_size.0, trans_size.1)
.title("米游社")
.center()
.user_agent(win_ua)
.user_agent(&win_ua)
// todo mac环境下没看到menu
.menu(menu::create_mhy_menu(handle.clone()))
.on_menu_event(move |app, event| menu::handle_menu_event(app, event))