mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-12 16:11:27 +08:00
✨ Feature(custom): support theme system and add a new theme hub for piclist
This commit is contained in:
@@ -11,7 +11,7 @@ import { createTray, setDockMenu } from 'apis/app/system'
|
||||
import { uploadChoosedFiles, uploadClipboardFiles } from 'apis/app/uploader/apis'
|
||||
import windowManager from 'apis/app/window/windowManager'
|
||||
import axios from 'axios'
|
||||
import { app, globalShortcut, Notification, protocol, screen } from 'electron'
|
||||
import { app, globalShortcut, nativeTheme, Notification, protocol, screen } from 'electron'
|
||||
import updater from 'electron-updater'
|
||||
import fs from 'fs-extra'
|
||||
|
||||
@@ -180,6 +180,12 @@ class LifeCycle {
|
||||
windowManager.create(IWindowList.TRAY_WINDOW)
|
||||
windowManager.create(IWindowList.SETTING_WINDOW)
|
||||
const isAutoListenClipboard = picgo.getConfig<boolean>(configPaths.settings.isAutoListenClipboard) || false
|
||||
const systemTheme = picgo.getConfig<'light' | 'dark' | 'system' | undefined>(configPaths.settings.systemTheme)
|
||||
if (systemTheme) {
|
||||
nativeTheme.themeSource = systemTheme
|
||||
} else {
|
||||
nativeTheme.themeSource = 'system'
|
||||
}
|
||||
const ClipboardWatcher = clipboardPoll
|
||||
if (isAutoListenClipboard) {
|
||||
picgo.saveConfig({ [configPaths.settings.isListeningClipboard]: true })
|
||||
@@ -362,7 +368,6 @@ class LifeCycle {
|
||||
}
|
||||
|
||||
async launchApp() {
|
||||
console.log('launchApp called', app.getPath('exe'))
|
||||
const gotTheLock = app.requestSingleInstanceLock()
|
||||
if (!gotTheLock) {
|
||||
app.quit()
|
||||
|
||||
Reference in New Issue
Block a user