From be4bca2c153644c6f83b0550f304e71d96d4eb04 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 23 Nov 2025 10:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AD=97=E4=BD=93=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E6=94=AF=E6=8C=81=E6=9C=80=E5=A4=9A=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=A4=E7=A7=8D=E5=AD=97=E4=BD=93=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/renderer/components/base/Selection.vue | 2 +- .../views/Setting/components/SettingBasic.vue | 19 +++++++++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index cbc45ae6..e42d4b0e 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -22,6 +22,7 @@ - 调换「歌词翻译」与「歌词罗马音」的位置,现在歌词罗马音在歌词翻译的上方展示 *若你想要恢复以前的行为,可以开启「调换歌词翻译与歌词罗马音位置」选项* - 更新代理配置规则,现在不启用代理时,图片、音频加载将不再走系统代理 (#2382 @Folltoshe) +- 字体设置可以最多设置两种字体([any-listen#82](https://github.com/any-listen/any-listen/issues/82)) ### 其他 diff --git a/src/renderer/components/base/Selection.vue b/src/renderer/components/base/Selection.vue index 7e6bd765..f75088b9 100644 --- a/src/renderer/components/base/Selection.vue +++ b/src/renderer/components/base/Selection.vue @@ -120,7 +120,7 @@ export default { display: inline-block; font-size: 12px; position: relative; - width: 300px; + width: var(--selection-width, 300px); &.active { .label { diff --git a/src/renderer/views/Setting/components/SettingBasic.vue b/src/renderer/views/Setting/components/SettingBasic.vue index 1409c433..3a0552a2 100644 --- a/src/renderer/views/Setting/components/SettingBasic.vue +++ b/src/renderer/views/Setting/components/SettingBasic.vue @@ -68,8 +68,10 @@ dd dd h3#basic_font {{ $t('setting__basic_font') }} - div - base-selection.gap-teft(:list="fontList" :model-value="appSetting['common.font']" item-key="id" item-name="label" @update:model-value="updateSetting({'common.font': $event})") + div(style="--selection-width: 12rem;") + base-selection.gap-left(:list="fontList" :model-value="fonts[0]" item-key="id" item-name="label" @update:model-value="updateFonts($event, fonts[1])") + base-selection.gap-left(v-if="fonts[0]" :list="fontList" :model-value="fonts[1]" item-key="id" item-name="label" @update:model-value="updateFonts(fonts[0], $event)") + //- base-selection.gap-teft(:list="fontList" :model-value="appSetting['common.font']" item-key="id" item-name="label" @update:model-value="updateSetting({'common.font': $event})") dd h3#basic_lang {{ $t('setting__basic_lang') }} @@ -300,6 +302,17 @@ export default { systemFontList.value = fonts.map(f => ({ id: f, label: f.replace(/(^"|"$)/g, '') })) }) + const fonts = computed(() => { + if (!appSetting['common.font']) return ['', ''] + let [f1 = '', f2 = ''] = appSetting['common.font'].split(',') + return [f1.trim(), f2.trim()] + }) + const updateFonts = (font1, font2) => { + let font = [] + if (font1) font.push(font1) + if (font2) font.push(font2) + updateSetting({ 'common.font': font.join(', ') }) + } const fontSizeList = computed(() => { return [ { id: 14, label: t('setting__basic_font_size_14px') }, @@ -319,6 +332,8 @@ export default { autoTheme, showAllTheme, themeList, + fonts, + updateFonts, // currentStting, // themes, // themeClassName,