feat:增加点和数字切换,减小点最大尺寸,增加range配色方案
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user