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