mirror of
https://github.com/viarotel-org/escrcpy.git
synced 2024-11-15 03:07:41 +01:00
fix: 🐛 修复设置主题跟随系统后没有生效的问题
This commit is contained in:
parent
eff127a940
commit
95a83f4072
@ -8,7 +8,7 @@
|
||||
@change="onChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in options"
|
||||
v-for="(item, index) in data.options"
|
||||
:key="index"
|
||||
:label="$t(item.label)"
|
||||
:value="item.value"
|
||||
|
@ -178,6 +178,7 @@
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<component
|
||||
:is="item_1.type"
|
||||
v-else
|
||||
|
@ -106,7 +106,7 @@
|
||||
"preferences.common.theme.placeholder": "Set theme",
|
||||
"preferences.common.theme.options[0]": "Light Mode",
|
||||
"preferences.common.theme.options[1]": "Dark Mode",
|
||||
"preferences.common.theme.options[2]": "System Default",
|
||||
"preferences.common.theme.options[2]": "Following system",
|
||||
"preferences.common.debug.name": "Debug",
|
||||
"preferences.common.debug.placeholder": "Enable debug mode",
|
||||
"preferences.common.debug.tips": "Show debug info in log, disable to improve performance. Restart to take effect.",
|
||||
|
@ -106,7 +106,7 @@
|
||||
"preferences.common.theme.placeholder": "设置主题",
|
||||
"preferences.common.theme.options[0]": "浅色模式",
|
||||
"preferences.common.theme.options[1]": "深色模式",
|
||||
"preferences.common.theme.options[2]": "系统自适应",
|
||||
"preferences.common.theme.options[2]": "跟随系统",
|
||||
"preferences.common.debug.name": "调试",
|
||||
"preferences.common.debug.placeholder": "是否启动软件调试",
|
||||
"preferences.common.debug.tips": "启用后可以在运行日志中查看软件运行情况,一般不需要开启可能会影响性能,注意: 改变此选项需要重启软件后才能生效。",
|
||||
|
@ -2,12 +2,11 @@ import { defineStore } from 'pinia'
|
||||
|
||||
const systemTheme = (key, value) => {
|
||||
if (key === 'change') {
|
||||
window.electron.ipcRenderer.on('app-theme-change', (_, ...args) =>
|
||||
return window.electron.ipcRenderer.on('app-theme-change', (_, ...args) =>
|
||||
value(...args),
|
||||
)
|
||||
return
|
||||
}
|
||||
window.electron.ipcRenderer.invoke(`app-theme-${key}`, value)
|
||||
return window.electron.ipcRenderer.invoke(`app-theme-${key}`, value)
|
||||
}
|
||||
|
||||
export const useThemeStore = defineStore({
|
||||
@ -55,9 +54,9 @@ export const useThemeStore = defineStore({
|
||||
|
||||
/** 监听系统主题色变化 */
|
||||
systemTheme('change', ({ value }) => {
|
||||
// console.log('systemTheme.change.value', value)
|
||||
console.log('systemTheme.change.value', value)
|
||||
const themeStore = useThemeStore()
|
||||
if (value !== themeStore.value) {
|
||||
if (value === 'system') {
|
||||
themeStore.update(value)
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user