Remove windows rounded corner option and force enable it, untested if it works
This commit is contained in:
@@ -10,7 +10,7 @@ use std::{
|
|||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
use sysinfo::System;
|
use sysinfo::System;
|
||||||
use tauri::{AppHandle, Emitter, Manager, PhysicalSize};
|
use tauri::{AppHandle, Emitter, Manager};
|
||||||
use tauri_plugin_dialog::{DialogExt, MessageDialogKind};
|
use tauri_plugin_dialog::{DialogExt, MessageDialogKind};
|
||||||
use tauri_plugin_opener::OpenerExt;
|
use tauri_plugin_opener::OpenerExt;
|
||||||
use tauri_plugin_os::platform;
|
use tauri_plugin_os::platform;
|
||||||
@@ -372,16 +372,6 @@ fn fix_mac_permissions(app: AppHandle, name: String, executable: String) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
|
||||||
fn windows_rounded_corners(app: AppHandle, enabled: bool) {
|
|
||||||
let window = app.get_webview_window("main");
|
|
||||||
let _ = window.clone().unwrap().set_shadow(enabled);
|
|
||||||
let _ = window
|
|
||||||
.clone()
|
|
||||||
.unwrap()
|
|
||||||
.set_size(PhysicalSize::new(1000.0, 632.0)); // Yes, this is needed.
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
@@ -406,7 +396,6 @@ pub fn run() {
|
|||||||
uninstall_version,
|
uninstall_version,
|
||||||
open_folder,
|
open_folder,
|
||||||
fix_mac_permissions,
|
fix_mac_permissions,
|
||||||
windows_rounded_corners
|
|
||||||
])
|
])
|
||||||
.setup(|app| {
|
.setup(|app| {
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
"titleBarStyle": "Overlay",
|
"titleBarStyle": "Overlay",
|
||||||
"hiddenTitle": true,
|
"hiddenTitle": true,
|
||||||
"decorations": false,
|
"decorations": false,
|
||||||
"shadow": false
|
"shadow": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"security": {
|
"security": {
|
||||||
|
|||||||
@@ -177,11 +177,6 @@ export default function RootLayout ({
|
|||||||
const versionsConfig = await readVersionsConfig()
|
const versionsConfig = await readVersionsConfig()
|
||||||
setDownloadedVersionsConfig(versionsConfig)
|
setDownloadedVersionsConfig(versionsConfig)
|
||||||
setNormalConfig(normalConfig)
|
setNormalConfig(normalConfig)
|
||||||
if (platform() == 'windows') {
|
|
||||||
invoke('windows_rounded_corners', {
|
|
||||||
enabled: normalConfig.settings.useWindowsRoundedCorners
|
|
||||||
})
|
|
||||||
}
|
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
})()
|
})()
|
||||||
}, [])
|
}, [])
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ export default function Settings () {
|
|||||||
const [allowNotifications, setAllowNotifications] = useState(false)
|
const [allowNotifications, setAllowNotifications] = useState(false)
|
||||||
const [useWineOnUnixWhenNeeded, setUseWineOnUnixWhenNeeded] = useState(false)
|
const [useWineOnUnixWhenNeeded, setUseWineOnUnixWhenNeeded] = useState(false)
|
||||||
const [wineOnUnixCommand, setWineOnUnixCommand] = useState('wine %path%')
|
const [wineOnUnixCommand, setWineOnUnixCommand] = useState('wine %path%')
|
||||||
const [useWindowsRoundedCorners, setUseWindowsRoundedCorners] =
|
|
||||||
useState(false)
|
|
||||||
const [loaded, setLoaded] = useState(false)
|
const [loaded, setLoaded] = useState(false)
|
||||||
const { normalConfig } = useGlobal()
|
const { normalConfig } = useGlobal()
|
||||||
|
|
||||||
@@ -29,9 +27,6 @@ export default function Settings () {
|
|||||||
)
|
)
|
||||||
setWineOnUnixCommand(normalConfig.settings.wineOnUnixCommand)
|
setWineOnUnixCommand(normalConfig.settings.wineOnUnixCommand)
|
||||||
setAllowNotifications(normalConfig.settings.allowNotifications)
|
setAllowNotifications(normalConfig.settings.allowNotifications)
|
||||||
setUseWindowsRoundedCorners(
|
|
||||||
normalConfig.settings.useWindowsRoundedCorners
|
|
||||||
)
|
|
||||||
setLoaded(true)
|
setLoaded(true)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -97,23 +92,6 @@ export default function Settings () {
|
|||||||
platform() == 'linux' && useWineOnUnixWhenNeeded ? '' : 'hidden'
|
platform() == 'linux' && useWineOnUnixWhenNeeded ? '' : 'hidden'
|
||||||
}`}
|
}`}
|
||||||
></input>
|
></input>
|
||||||
<Setting
|
|
||||||
label='Use rounded corners (if supported)'
|
|
||||||
value={useWindowsRoundedCorners}
|
|
||||||
onChange={async () => {
|
|
||||||
while (normalConfig != null) {
|
|
||||||
setUseWindowsRoundedCorners(!useWindowsRoundedCorners)
|
|
||||||
normalConfig.settings.useWindowsRoundedCorners =
|
|
||||||
!useWindowsRoundedCorners
|
|
||||||
await writeNormalConfig(normalConfig)
|
|
||||||
invoke('windows_rounded_corners', {
|
|
||||||
enabled: !useWindowsRoundedCorners
|
|
||||||
})
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
className={platform() == 'windows' ? '' : 'hidden'}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ export class SettingsType {
|
|||||||
public checkForNewVersionOnLoad: boolean = true,
|
public checkForNewVersionOnLoad: boolean = true,
|
||||||
public allowNotifications: boolean = true,
|
public allowNotifications: boolean = true,
|
||||||
public useWineOnUnixWhenNeeded: boolean = false,
|
public useWineOnUnixWhenNeeded: boolean = false,
|
||||||
public wineOnUnixCommand: string = 'wine %path%',
|
public wineOnUnixCommand: string = 'wine %path%'
|
||||||
public useWindowsRoundedCorners: boolean = false
|
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user