mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-02 02:58:13 -05:00
✨ Feature(custom): add ipc event handlers for mini window icon and set on top
This commit is contained in:
parent
3587bc5225
commit
892a1471b5
@ -325,6 +325,16 @@ export default {
|
||||
settingWindow.hide()
|
||||
})
|
||||
|
||||
ipcMain.on('updateMiniIcon', (_: IpcMainEvent, iconPath: string) => {
|
||||
const miniWindow = windowManager.get(IWindowList.MINI_WINDOW)!
|
||||
miniWindow.webContents.send('updateMiniIcon', iconPath)
|
||||
})
|
||||
|
||||
ipcMain.on('miniWindowOntop', (_: IpcMainEvent, val: boolean) => {
|
||||
const miniWindow = windowManager.get(IWindowList.MINI_WINDOW)!
|
||||
miniWindow.setAlwaysOnTop(val)
|
||||
})
|
||||
|
||||
ipcMain.on('refreshSettingWindow', () => {
|
||||
const settingWindow = windowManager.get(IWindowList.SETTING_WINDOW)!
|
||||
settingWindow.webContents.reloadIgnoringCache()
|
||||
|
@ -88,7 +88,7 @@ async function initLogoPath () {
|
||||
onBeforeMount(async () => {
|
||||
os.value = process.platform
|
||||
await initLogoPath()
|
||||
ipcRenderer.on('uploadProgress', (event: IpcRendererEvent, _progress: number) => {
|
||||
ipcRenderer.on('uploadProgress', (_: IpcRendererEvent, _progress: number) => {
|
||||
if (_progress !== -1) {
|
||||
showProgress.value = true
|
||||
progress.value = _progress
|
||||
@ -97,6 +97,9 @@ onBeforeMount(async () => {
|
||||
showError.value = true
|
||||
}
|
||||
})
|
||||
ipcRenderer.on('updateMiniIcon', async () => {
|
||||
await initLogoPath()
|
||||
})
|
||||
window.addEventListener('mousedown', handleMouseDown, false)
|
||||
window.addEventListener('mousemove', handleMouseMove, false)
|
||||
window.addEventListener('mouseup', handleMouseUp, false)
|
||||
@ -215,6 +218,7 @@ function openContextMenu () {
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
ipcRenderer.removeAllListeners('uploadProgress')
|
||||
ipcRenderer.removeAllListeners('updateMiniIcon')
|
||||
window.removeEventListener('mousedown', handleMouseDown, false)
|
||||
window.removeEventListener('mousemove', handleMouseMove, false)
|
||||
window.removeEventListener('mouseup', handleMouseUp, false)
|
||||
|
@ -2478,7 +2478,7 @@ function handleAutoCloseMiniWindowChange (val: ICheckBoxValueType) {
|
||||
|
||||
function handleMiniWindowOntop (val: ICheckBoxValueType) {
|
||||
saveConfig(configPaths.settings.miniWindowOntop, val)
|
||||
$message.info($T('TIPS_NEED_RELOAD'))
|
||||
ipcRenderer.send('miniWindowOntop', val)
|
||||
}
|
||||
|
||||
async function handleMiniIconPath (_: Event) {
|
||||
@ -2486,13 +2486,12 @@ async function handleMiniIconPath (_: Event) {
|
||||
if (result && result[0]) {
|
||||
form.customMiniIcon = result[0]
|
||||
saveConfig(configPaths.settings.customMiniIcon, form.customMiniIcon)
|
||||
$message.info($T('TIPS_NEED_RELOAD'))
|
||||
ipcRenderer.send('updateMiniIcon', form.customMiniIcon)
|
||||
}
|
||||
}
|
||||
|
||||
function handleIsCustomMiniIcon (val: ICheckBoxValueType) {
|
||||
saveConfig(configPaths.settings.isCustomMiniIcon, val)
|
||||
$message.info($T('TIPS_NEED_RELOAD'))
|
||||
}
|
||||
|
||||
function handleAutoCopyUrl (val: ICheckBoxValueType) {
|
||||
|
Loading…
Reference in New Issue
Block a user