|
242 | 242 | </n-flex> |
243 | 243 | </n-card> |
244 | 244 | <n-collapse-transition :show="settingStore.LyricFont !== 'follow'"> |
245 | | - <n-card class="set-item"> |
| 245 | + <n-card |
| 246 | + v-for="item in languageFontSettings" |
| 247 | + :key="item.key" |
| 248 | + class="set-item" |
| 249 | + > |
246 | 250 | <div class="label"> |
247 | | - <n-text class="name">英语歌词字体</n-text> |
248 | | - <n-text class="tip" :depth="3"> 是否在歌词为英语时单独设置字体 </n-text> |
| 251 | + <n-text class="name">{{ item.name }}歌词字体</n-text> |
| 252 | + <n-text class="tip" :depth="3"> {{ item.tip }} </n-text> |
249 | 253 | </div> |
250 | 254 | <n-flex> |
251 | 255 | <Transition name="fade" mode="out-in"> |
252 | 256 | <n-button |
253 | | - v-if="settingStore.englishLyricFont !== 'follow'" |
| 257 | + v-if="settingStore[item.key] !== 'follow'" |
254 | 258 | type="primary" |
255 | 259 | strong |
256 | 260 | secondary |
257 | | - @click="settingStore.englishLyricFont = 'follow'" |
| 261 | + @click="settingStore[item.key] = 'follow'" |
258 | 262 | > |
259 | 263 | 恢复默认 |
260 | 264 | </n-button> |
261 | 265 | </Transition> |
262 | 266 | <n-select |
263 | | - v-model:value="settingStore.englishLyricFont" |
264 | | - :options="[ |
265 | | - { label: '跟随全局', value: 'follow' }, |
266 | | - ...allFontsData.filter((v) => v.value !== 'default'), |
267 | | - ]" |
268 | | - class="set" |
269 | | - filterable |
270 | | - /> |
271 | | - </n-flex> |
272 | | - </n-card> |
273 | | - <n-card class="set-item"> |
274 | | - <div class="label"> |
275 | | - <n-text class="name">日语歌词字体</n-text> |
276 | | - <n-text class="tip" :depth="3"> 是否在歌词为日语时单独设置字体 </n-text> |
277 | | - </div> |
278 | | - <n-flex> |
279 | | - <Transition name="fade" mode="out-in"> |
280 | | - <n-button |
281 | | - v-if="settingStore.japaneseLyricFont !== 'follow'" |
282 | | - type="primary" |
283 | | - strong |
284 | | - secondary |
285 | | - @click="settingStore.japaneseLyricFont = 'follow'" |
286 | | - > |
287 | | - 恢复默认 |
288 | | - </n-button> |
289 | | - </Transition> |
290 | | - <n-select |
291 | | - v-model:value="settingStore.japaneseLyricFont" |
292 | | - :options="[ |
293 | | - { label: '跟随全局', value: 'follow' }, |
294 | | - ...allFontsData.filter((v) => v.value !== 'default'), |
295 | | - ]" |
296 | | - class="set" |
297 | | - filterable |
298 | | - /> |
299 | | - </n-flex> |
300 | | - </n-card> |
301 | | - <n-card class="set-item"> |
302 | | - <div class="label"> |
303 | | - <n-text class="name">韩语歌词字体</n-text> |
304 | | - <n-text class="tip" :depth="3"> 是否在歌词为韩语时单独设置字体 </n-text> |
305 | | - </div> |
306 | | - <n-flex> |
307 | | - <Transition name="fade" mode="out-in"> |
308 | | - <n-button |
309 | | - v-if="settingStore.koreanLyricFont !== 'follow'" |
310 | | - type="primary" |
311 | | - strong |
312 | | - secondary |
313 | | - @click="settingStore.koreanLyricFont = 'follow'" |
314 | | - > |
315 | | - 恢复默认 |
316 | | - </n-button> |
317 | | - </Transition> |
318 | | - <n-select |
319 | | - v-model:value="settingStore.koreanLyricFont" |
| 267 | + v-model:value="settingStore[item.key]" |
320 | 268 | :options="[ |
321 | 269 | { label: '跟随全局', value: 'follow' }, |
322 | 270 | ...allFontsData.filter((v) => v.value !== 'default'), |
@@ -431,6 +379,25 @@ const closeTaskbarProgress = (val: boolean) => { |
431 | 379 | if (!val) window.electron.ipcRenderer.send("set-bar", "none"); |
432 | 380 | }; |
433 | 381 |
|
| 382 | +// 语言字体配置 |
| 383 | +const languageFontSettings = [ |
| 384 | + { |
| 385 | + name: "英语", |
| 386 | + key: "englishLyricFont" as const, |
| 387 | + tip: "是否在歌词为英语时单独设置字体", |
| 388 | + }, |
| 389 | + { |
| 390 | + name: "日语", |
| 391 | + key: "japaneseLyricFont" as const, |
| 392 | + tip: "是否在歌词为日语时单独设置字体", |
| 393 | + }, |
| 394 | + { |
| 395 | + name: "韩语", |
| 396 | + key: "koreanLyricFont" as const, |
| 397 | + tip: "是否在歌词为韩语时单独设置字体", |
| 398 | + }, |
| 399 | +]; |
| 400 | +
|
434 | 401 | // 获取全部系统字体 |
435 | 402 | const getAllSystemFonts = async () => { |
436 | 403 | const allFonts = await window.electron.ipcRenderer.invoke("get-all-fonts"); |
|
0 commit comments