Feature: add check to avoid hide dock and tray at the same time

This commit is contained in:
萌萌哒赫萝
2023-04-09 18:21:32 +08:00
parent 4043dbfb25
commit 8421925f9d
5 changed files with 16 additions and 3 deletions

View File

@@ -1242,6 +1242,10 @@ function updateHelperChange (val: ICheckBoxValueType) {
}
function handleHideDockChange (val: ICheckBoxValueType) {
if (val && currentStartMode.value === 'no-tray') {
ElMessage.warning($T('SETTINGS_ISHIDEDOCK_TIPS'))
return
}
saveConfig('settings.isHideDock', val)
sendToMain(HIDE_DOCK, val)
}
@@ -1457,12 +1461,17 @@ function handleLanguageChange (val: string) {
}
function handleStartModeChange (val: 'quiet' | 'mini' | 'main' | 'no-tray') {
if (val === 'no-tray') {
if (form.isHideDock) {
ElMessage.warning($T('SETTINGS_ISHIDEDOCK_TIPS'))
currentStartMode.value = 'quiet'
return
}
$message.info($T('TIPS_NEED_RELOAD'))
}
saveConfig({
'settings.startMode': val
})
if (val === 'no-tray') {
$message.info($T('TIPS_NEED_RELOAD'))
}
}
function goConfigPage () {

View File

@@ -185,6 +185,7 @@ interface ILocales {
SETTINGS_COMPRESS_AND_WATERMARK: string
SETTINGS_SYNC_DELETE_CLOUD: string
SETTINGS_ISHIDEDOCK: string
SETTINGS_ISHIDEDOCK_TIPS: string
SHORTCUT_NAME: string
SHORTCUT_BIND: string
SHORTCUT_STATUS: string