mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
修复 macOS Retina 下窗口尺寸异常与默认窗口过小问题
This commit is contained in:
@@ -126,7 +126,10 @@ pub async fn window_resize(
|
||||
#[cfg(desktop)]
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
window
|
||||
.set_size(tauri::Size::Physical(tauri::PhysicalSize { width, height }))
|
||||
.set_size(tauri::Size::Logical(tauri::LogicalSize {
|
||||
width: width as f64,
|
||||
height: height as f64,
|
||||
}))
|
||||
.map_err(|e| e.to_string())?;
|
||||
}
|
||||
Ok(())
|
||||
|
||||
@@ -298,9 +298,9 @@ fn setup_tray(_app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
|
||||
#[cfg(desktop)]
|
||||
fn setup_window_events(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
let _ = window.set_size(tauri::Size::Physical(tauri::PhysicalSize {
|
||||
width: 1180,
|
||||
height: 680,
|
||||
let _ = window.set_size(tauri::Size::Logical(tauri::LogicalSize {
|
||||
width: 1180.0,
|
||||
height: 680.0,
|
||||
}));
|
||||
let _ = window.center();
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
"windows": [
|
||||
{
|
||||
"title": "SecScore",
|
||||
"width": 10000,
|
||||
"height": 10000,
|
||||
"width": 1180,
|
||||
"height": 680,
|
||||
"resizable": true,
|
||||
"fullscreen": false,
|
||||
"decorations": false,
|
||||
|
||||
Reference in New Issue
Block a user