mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-01-22 14:28:12 -05:00
✨ Feature: add config item to hide dock, only for macos
This commit is contained in:
parent
28caf56331
commit
0466fa78a4
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,6 +9,7 @@ node_modules/
|
||||
npm-debug.log
|
||||
npm-debug.log.*
|
||||
thumbs.db
|
||||
remote-notice.json
|
||||
!.gitkeep
|
||||
yarn-error.log
|
||||
docs/dist/
|
||||
|
@ -188,7 +188,7 @@ SETTINGS_CUSTOM_MINI_ICON_PATH: Custom Mini Window Icon Path
|
||||
SETTINGS_CUSTOM_MINI_ICON: Custom Mini Window Icon
|
||||
SETTINGS_COMPRESS_AND_WATERMARK: Compress and Watermark
|
||||
SETTINGS_SYNC_DELETE_CLOUD: Sync delete from cloud storage of gallery
|
||||
|
||||
SETTINGS_ISHIDEDOCK: Hide Dock Icon
|
||||
# shortcut-page
|
||||
|
||||
BUILTIN_CLIPBOARD_TIPS: Use builtin clipboard function to upload instead of using scripts
|
||||
|
@ -189,6 +189,7 @@ SETTINGS_CUSTOM_MINI_ICON_PATH: 自定义Mini窗口图标路径
|
||||
SETTINGS_CUSTOM_MINI_ICON: 是否自定义Mini窗口图标
|
||||
SETTINGS_COMPRESS_AND_WATERMARK: 设置图片水印和压缩-格式转换等参数
|
||||
SETTINGS_SYNC_DELETE_CLOUD: 相册内删除时同步删除云端文件
|
||||
SETTINGS_ISHIDEDOCK: 是否隐藏dock图标
|
||||
|
||||
# shortcut-page
|
||||
|
||||
|
@ -189,7 +189,7 @@ SETTINGS_CUSTOM_MINI_ICON_PATH: 自訂Mini視窗圖示路徑
|
||||
SETTINGS_CUSTOM_MINI_ICON: 自訂Mini視窗圖示
|
||||
SETTINGS_COMPRESS_AND_WATERMARK: 設置圖片浮水印和壓縮-格式轉換等參數
|
||||
SETTINGS_SYNC_DELETE_CLOUD: 從相簿中刪除並同步從雲端刪除
|
||||
|
||||
SETTINGS_ISHIDEDOCK: 是否隱藏dock圖示
|
||||
# shortcut-page
|
||||
|
||||
SHORTCUT_NAME: 快捷鍵名稱
|
||||
|
@ -30,7 +30,8 @@ import {
|
||||
RELOAD_APP,
|
||||
SHOW_PLUGIN_PAGE_MENU,
|
||||
SET_MINI_WINDOW_POS,
|
||||
GET_PICBEDS
|
||||
GET_PICBEDS,
|
||||
HIDE_DOCK
|
||||
} from '#/events/constants'
|
||||
import {
|
||||
uploadClipboardFiles,
|
||||
@ -270,6 +271,13 @@ export default {
|
||||
const window = BrowserWindow.getFocusedWindow()
|
||||
window?.setBounds(pos)
|
||||
})
|
||||
ipcMain.on(HIDE_DOCK, (_evt: IpcMainEvent, val: boolean) => {
|
||||
if (val) {
|
||||
app.dock.hide()
|
||||
} else {
|
||||
app.dock.show()
|
||||
}
|
||||
})
|
||||
},
|
||||
dispose () {}
|
||||
}
|
||||
|
@ -175,7 +175,8 @@ class LifeCycle {
|
||||
}
|
||||
await remoteNoticeHandler.init()
|
||||
remoteNoticeHandler.triggerHook(IRemoteNoticeTriggerHook.APP_START)
|
||||
if (db.get('settings.startMode') === 'mini') {
|
||||
const startMode = db.get('settings.startMode') || 'quiet'
|
||||
if (startMode === 'mini') {
|
||||
windowManager.create(IWindowList.MINI_WINDOW)
|
||||
const miniWindow = windowManager.get(IWindowList.MINI_WINDOW)!
|
||||
if (db.get('settings.miniWindowOntop')) {
|
||||
@ -198,11 +199,15 @@ class LifeCycle {
|
||||
})
|
||||
miniWindow.show()
|
||||
miniWindow.focus()
|
||||
} else if (db.get('settings.startMode') === 'main') {
|
||||
} else if (startMode === 'main') {
|
||||
const settingWindow = windowManager.get(IWindowList.SETTING_WINDOW)!
|
||||
settingWindow.show()
|
||||
settingWindow.focus()
|
||||
}
|
||||
const isHideDock = db.get('settings.isHideDock') || false
|
||||
if (isHideDock) {
|
||||
app.dock.hide()
|
||||
}
|
||||
}
|
||||
app.whenReady().then(readyFunction)
|
||||
}
|
||||
|
@ -70,6 +70,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$T('SETTINGS_ISHIDEDOCK')"
|
||||
>
|
||||
<el-switch
|
||||
v-model="form.isHideDock"
|
||||
:active-text="$T('SETTINGS_OPEN')"
|
||||
:inactive-text="$T('SETTINGS_CLOSE')"
|
||||
@change="handleHideDockChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$T('SETTINGS_MIGRATE_FROM_PICGO')"
|
||||
>
|
||||
@ -897,7 +907,7 @@
|
||||
import { ElForm, ElMessage as $message, ElMessage, ElMessageBox, FormRules } from 'element-plus'
|
||||
import { Reading, QuestionFilled } from '@element-plus/icons-vue'
|
||||
import pkg from 'root/package.json'
|
||||
import { PICGO_OPEN_FILE, OPEN_URL, GET_PICBEDS } from '#/events/constants'
|
||||
import { PICGO_OPEN_FILE, OPEN_URL, GET_PICBEDS, HIDE_DOCK } from '#/events/constants'
|
||||
import {
|
||||
ipcRenderer
|
||||
} from 'electron'
|
||||
@ -1022,7 +1032,8 @@ const form = reactive<ISettingForm>({
|
||||
logFileSizeLimit: 10,
|
||||
deleteCloudFile: false,
|
||||
isCustomMiniIcon: false,
|
||||
customMiniIcon: ''
|
||||
customMiniIcon: '',
|
||||
isHideDock: false
|
||||
})
|
||||
|
||||
const languageList = i18nManager.languageList.map(item => ({
|
||||
@ -1117,6 +1128,7 @@ async function initData () {
|
||||
form.deleteCloudFile = settings.deleteCloudFile || false
|
||||
form.isCustomMiniIcon = settings.isCustomMiniIcon || false
|
||||
form.customMiniIcon = settings.customMiniIcon || ''
|
||||
form.isHideDock = settings.isHideDock || false
|
||||
currentLanguage.value = settings.language ?? 'zh-CN'
|
||||
currentStartMode.value = settings.startMode || 'quiet'
|
||||
customLink.value = settings.customLink || '$url'
|
||||
@ -1166,7 +1178,7 @@ function openLogSetting () {
|
||||
|
||||
async function cancelCustomLink () {
|
||||
customLinkVisible.value = false
|
||||
customLink.value = await getConfig<string>('settings.customLink') || '$url'
|
||||
customLink.value = await getConfig<string>('settings.customLink') || '![$fileName]($url)'
|
||||
}
|
||||
|
||||
function confirmCustomLink () {
|
||||
@ -1222,6 +1234,11 @@ function updateHelperChange (val: ICheckBoxValueType) {
|
||||
saveConfig('settings.showUpdateTip', val)
|
||||
}
|
||||
|
||||
function handleHideDockChange (val: ICheckBoxValueType) {
|
||||
saveConfig('settings.isHideDock', val)
|
||||
sendToMain(HIDE_DOCK, val)
|
||||
}
|
||||
|
||||
function useBuiltinClipboardChange (val: ICheckBoxValueType) {
|
||||
saveConfig('settings.useBuiltinClipboard', val)
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ export const MINIMIZE_WINDOW = 'MINIMIZE_WINDOW'
|
||||
export const CLOSE_WINDOW = 'CLOSE_WINDOW'
|
||||
export const OPEN_USER_STORE_FILE = 'OPEN_USER_STORE_FILE'
|
||||
export const OPEN_URL = 'OPEN_URL'
|
||||
export const HIDE_DOCK = 'HIDE_DOCK'
|
||||
export const RELOAD_APP = 'RELOAD_APP'
|
||||
export const PICGO_CONFIG_PLUGIN = 'PICGO_CONFIG_PLUGIN'
|
||||
export const PICGO_HANDLE_PLUGIN_ING = 'PICGO_HANDLE_PLUGIN_ING'
|
||||
|
1
src/universal/types/i18n.d.ts
vendored
1
src/universal/types/i18n.d.ts
vendored
@ -183,6 +183,7 @@ interface ILocales {
|
||||
SETTINGS_CUSTOM_MINI_ICON: string
|
||||
SETTINGS_COMPRESS_AND_WATERMARK: string
|
||||
SETTINGS_SYNC_DELETE_CLOUD: string
|
||||
SETTINGS_ISHIDEDOCK: string
|
||||
SHORTCUT_NAME: string
|
||||
SHORTCUT_BIND: string
|
||||
SHORTCUT_STATUS: string
|
||||
|
3
src/universal/types/view.d.ts
vendored
3
src/universal/types/view.d.ts
vendored
@ -14,7 +14,8 @@ interface ISettingForm {
|
||||
logFileSizeLimit: number,
|
||||
deleteCloudFile: boolean,
|
||||
isCustomMiniIcon: boolean,
|
||||
customMiniIcon: string
|
||||
customMiniIcon: string,
|
||||
isHideDock: boolean
|
||||
}
|
||||
|
||||
interface IShortKeyMap {
|
||||
|
Loading…
Reference in New Issue
Block a user