兼容url格式的主题背景图片
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { throttle } from '@common/utils'
|
||||
import { isUrl, throttle } from '@common/utils'
|
||||
import migrateSetting from '@common/utils/migrateSetting'
|
||||
import getStore from '@main/utils/store'
|
||||
import { STORE_NAMES, URL_SCHEME_RXP } from '@common/constants'
|
||||
@@ -247,7 +247,10 @@ export const getTheme = () => {
|
||||
if (theme) {
|
||||
if (theme.config.extInfo['--background-image'] != 'none') {
|
||||
theme = copyTheme(theme)
|
||||
theme.config.extInfo['--background-image'] = `url(file:///${joinPath(global.lxDataPath, 'theme_images', theme.config.extInfo['--background-image']).replaceAll('\\', '/')})`
|
||||
theme.config.extInfo['--background-image'] =
|
||||
isUrl(theme.config.extInfo['--background-image'])
|
||||
? `url(${theme.config.extInfo['--background-image']})`
|
||||
: `url(file:///${joinPath(global.lxDataPath, 'theme_images', theme.config.extInfo['--background-image']).replaceAll('\\', '/')})`
|
||||
}
|
||||
} else {
|
||||
themeId = global.lx.appSetting['theme.id'] == 'auto' && shouldUseDarkColors ? 'black' : 'green'
|
||||
|
||||
Reference in New Issue
Block a user