diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 40fdd66..18a9c9d 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -9,6 +9,8 @@ "core:window:allow-start-dragging", "core:window:allow-close", "core:window:allow-minimize", + "core:window:allow-set-shadow", + "core:window:allow-set-size", "opener:default", "dialog:default", "dialog:allow-open" diff --git a/src/assets/global.css b/src/assets/global.css index d4a3624..d84c341 100644 --- a/src/assets/global.css +++ b/src/assets/global.css @@ -28,4 +28,7 @@ /* 尺寸 */ --titlebar-height: 38px; + + --set-item-title-size: 14px; + --set-item-desc-size: 12px; } \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 03a535f..65fb592 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -45,6 +45,15 @@ const routes = [ title: "外观设置", }, }, + { + path: "/setting/reader-setting", + name: "ReaderSetting", + component: () => import("@/views/setting/ReaderSetting.vue"), + meta: { + isCache: true, + title: "阅读设置", + }, + }, { path: "/setting/shortcut", name: "Shortcut", diff --git a/src/stores/setting.ts b/src/stores/setting.ts new file mode 100644 index 0000000..a3073f9 --- /dev/null +++ b/src/stores/setting.ts @@ -0,0 +1,20 @@ +import { defineStore } from "pinia" + +export const useSettingStore = defineStore("setting", { + state: () => ({ + appearance: { + theme: "light", + showShadow: false, + }, + reader: { + fontSize: 12, + showShadow: false, + fontColor: "#000000", + backgroundColor: "#ffffff", + windowWidth: 300, + windowHeight: 400, + } + }), + + persist: true, +}) diff --git a/src/types/components.d.ts b/src/types/components.d.ts index 77d7ef0..588ee17 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -16,6 +16,7 @@ declare module 'vue' { NAnchor: typeof import('naive-ui')['NAnchor'] NAnchorLink: typeof import('naive-ui')['NAnchorLink'] NButton: typeof import('naive-ui')['NButton'] + NColorPicker: typeof import('naive-ui')['NColorPicker'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NDescriptions: typeof import('naive-ui')['NDescriptions'] NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem'] @@ -29,6 +30,7 @@ declare module 'vue' { NGrid: typeof import('naive-ui')['NGrid'] NIcon: typeof import('naive-ui')['NIcon'] NInput: typeof import('naive-ui')['NInput'] + NInputNumber: typeof import('naive-ui')['NInputNumber'] NLayout: typeof import('naive-ui')['NLayout'] NLayoutContent: typeof import('naive-ui')['NLayoutContent'] NLayoutHeader: typeof import('naive-ui')['NLayoutHeader'] @@ -42,6 +44,7 @@ declare module 'vue' { NSpace: typeof import('naive-ui')['NSpace'] NSpin: typeof import('naive-ui')['NSpin'] NSwitch: typeof import('naive-ui')['NSwitch'] + NText: typeof import('naive-ui')['NText'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } diff --git a/src/views/Home.vue b/src/views/Home.vue index 6b5117e..8e684d5 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -118,7 +118,7 @@ diff --git a/src/views/Reader.vue b/src/views/Reader.vue index 721f1bd..a78905a 100644 --- a/src/views/Reader.vue +++ b/src/views/Reader.vue @@ -1,5 +1,5 @@ diff --git a/src/views/setting/ReaderSetting.vue b/src/views/setting/ReaderSetting.vue new file mode 100644 index 0000000..b78b6c9 --- /dev/null +++ b/src/views/setting/ReaderSetting.vue @@ -0,0 +1,191 @@ + + + + +