From 0012a5dc19d876a03c8fd5eb2587c1dc5bfbdafe Mon Sep 17 00:00:00 2001 From: landaiqing Date: Sun, 21 Sep 2025 22:17:41 +0800 Subject: [PATCH] :sparkles: Added loading animation switch --- .../voidraft/internal/models/models.ts | 9 + frontend/src/i18n/locales/en-US.ts | 1 + frontend/src/i18n/locales/zh-CN.ts | 1 + frontend/src/stores/configStore.ts | 5 + frontend/src/views/editor/Editor.vue | 2 +- .../src/views/settings/pages/GeneralPage.vue | 9 + .../src/views/settings/pages/TestPage.vue | 531 ------------------ internal/models/config.go | 16 +- 8 files changed, 36 insertions(+), 538 deletions(-) diff --git a/frontend/bindings/voidraft/internal/models/models.ts b/frontend/bindings/voidraft/internal/models/models.ts index 79a7255..2581207 100644 --- a/frontend/bindings/voidraft/internal/models/models.ts +++ b/frontend/bindings/voidraft/internal/models/models.ts @@ -484,6 +484,12 @@ export class GeneralConfig { */ "globalHotkey": HotkeyCombo; + /** + * 界面设置 + * 是否启用加载动画 + */ + "enableLoadingAnimation": boolean; + /** Creates a new GeneralConfig instance. */ constructor($$source: Partial = {}) { if (!("alwaysOnTop" in $$source)) { @@ -507,6 +513,9 @@ export class GeneralConfig { if (!("globalHotkey" in $$source)) { this["globalHotkey"] = (new HotkeyCombo()); } + if (!("enableLoadingAnimation" in $$source)) { + this["enableLoadingAnimation"] = false; + } Object.assign(this, $$source); } diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index c478bd5..acefadb 100644 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -135,6 +135,7 @@ export default { enableSystemTray: 'Enable System Tray', alwaysOnTop: 'Always on Top', enableWindowSnap: 'Enable Window Snapping', + enableLoadingAnimation: 'Enable Loading Animation', startup: 'Startup Settings', startAtLogin: 'Start at Login', dataStorage: 'Data Storage', diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index 9a29338..7b9d10f 100644 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -136,6 +136,7 @@ export default { enableSystemTray: '启用系统托盘', alwaysOnTop: '窗口始终置顶', enableWindowSnap: '启用窗口吸附', + enableLoadingAnimation: '启用加载动画', startup: '启动设置', startAtLogin: '开机自启动', dataStorage: '数据存储', diff --git a/frontend/src/stores/configStore.ts b/frontend/src/stores/configStore.ts index c1efb4c..3cfc228 100644 --- a/frontend/src/stores/configStore.ts +++ b/frontend/src/stores/configStore.ts @@ -64,6 +64,7 @@ const GENERAL_CONFIG_KEY_MAP: GeneralConfigKeyMap = { enableGlobalHotkey: 'general.enableGlobalHotkey', globalHotkey: 'general.globalHotkey', enableWindowSnap: 'general.enableWindowSnap', + enableLoadingAnimation: 'general.enableLoadingAnimation', } as const; const EDITING_CONFIG_KEY_MAP: EditingConfigKeyMap = { @@ -179,6 +180,7 @@ const DEFAULT_CONFIG: AppConfig = { key: 'X' }, enableWindowSnap: true, + enableLoadingAnimation: true, }, editing: { fontSize: CONFIG_LIMITS.fontSize.default, @@ -526,6 +528,9 @@ export const useConfigStore = defineStore('config', () => { // 窗口吸附配置相关方法 setEnableWindowSnap: async (value: boolean) => await updateGeneralConfig('enableWindowSnap', value), + // 加载动画配置相关方法 + setEnableLoadingAnimation: async (value: boolean) => await updateGeneralConfig('enableLoadingAnimation', value), + // 更新配置相关方法 setAutoUpdate: async (value: boolean) => await updateUpdatesConfig('autoUpdate', value), diff --git a/frontend/src/views/editor/Editor.vue b/frontend/src/views/editor/Editor.vue index 59e45e5..7e895f3 100644 --- a/frontend/src/views/editor/Editor.vue +++ b/frontend/src/views/editor/Editor.vue @@ -47,7 +47,7 @@ onBeforeUnmount(() => {