feat:增加点和数字切换,减小点最大尺寸,增加range配色方案

This commit is contained in:
lenn
2026-04-09 09:17:07 +08:00
parent 1c3a811154
commit a3cefc3c79
78 changed files with 786 additions and 296 deletions

View File

@@ -1,4 +1,6 @@
use tauri::{AppHandle, Manager, WebviewWindow};
use super::serial::SerialConnectionState;
use crate::commands::serial::shutdown_active_session;
use tauri::{AppHandle, Manager, State, WebviewWindow};
fn main_window(app: &AppHandle) -> Result<WebviewWindow, String> {
app.get_webview_window("main")
@@ -25,8 +27,14 @@ pub fn win_toggle_maximize(app: AppHandle) -> Result<(), String> {
}
#[tauri::command]
pub fn win_close(app: AppHandle) -> Result<(), String> {
main_window(&app)?
.close()
.map_err(|error| error.to_string())
pub async fn win_close(
app: AppHandle,
state: State<'_, SerialConnectionState>,
) -> Result<(), String> {
shutdown_active_session(&state)
.await
.map_err(|error| error.to_string())?;
app.exit(0);
Ok(())
}