diff --git a/src/layouts/modules/theme-drawer/modules/appearance/index.vue b/src/layouts/modules/theme-drawer/modules/appearance/index.vue index 259828c5..a7f65e40 100644 --- a/src/layouts/modules/theme-drawer/modules/appearance/index.vue +++ b/src/layouts/modules/theme-drawer/modules/appearance/index.vue @@ -1,6 +1,7 @@ + + + + diff --git a/src/layouts/modules/theme-drawer/modules/preset/modules/theme-preset.vue b/src/layouts/modules/theme-drawer/modules/preset/modules/theme-preset.vue index f31ea220..9248b396 100644 --- a/src/layouts/modules/theme-drawer/modules/preset/modules/theme-preset.vue +++ b/src/layouts/modules/theme-drawer/modules/preset/modules/theme-preset.vue @@ -14,6 +14,7 @@ type ThemePreset = Pick< | 'colourWeakness' | 'recommendColor' | 'themeColor' + | 'themeRadius' | 'otherColor' | 'isInfoFollowPrimary' | 'layout' diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 523648c1..4f8bd7bb 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -83,6 +83,9 @@ const local: App.I18n.Schema = { error: 'Error', followPrimary: 'Follow Primary' }, + themeRadius: { + title: 'Theme Radius' + }, recommendColor: 'Apply Recommended Color Algorithm', recommendColorDesc: 'The recommended color algorithm refers to', preset: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 4896f984..499fa657 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -83,6 +83,9 @@ const local: App.I18n.Schema = { error: '错误色', followPrimary: '跟随主色' }, + themeRadius: { + title: '主题圆角' + }, recommendColor: '应用推荐算法的颜色', recommendColorDesc: '推荐颜色的算法参照', preset: { diff --git a/src/store/modules/theme/index.ts b/src/store/modules/theme/index.ts index b0380471..26422b82 100644 --- a/src/store/modules/theme/index.ts +++ b/src/store/modules/theme/index.ts @@ -53,7 +53,7 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => { }); /** Naive theme */ - const naiveTheme = computed(() => getNaiveTheme(themeColors.value, settings.value.recommendColor)); + const naiveTheme = computed(() => getNaiveTheme(themeColors.value, settings.value)); /** * Settings json diff --git a/src/store/modules/theme/shared.ts b/src/store/modules/theme/shared.ts index e980a799..82931719 100644 --- a/src/store/modules/theme/shared.ts +++ b/src/store/modules/theme/shared.ts @@ -236,22 +236,23 @@ function getNaiveThemeColors(colors: App.Theme.ThemeColor, recommended = false) /** * Get naive theme * - * @param colors Theme colors - * @param [recommended=false] Use recommended color. Default is `false` + * @param settings Theme settings object. + * @param settings.recommendColor Whether to use recommended color palette. + * @param settings.themeRadius Border radius to use in the theme (in px). */ -export function getNaiveTheme(colors: App.Theme.ThemeColor, recommended = false) { +export function getNaiveTheme(colors: App.Theme.ThemeColor, settings: App.Theme.ThemeSetting) { const { primary: colorLoading } = colors; const theme: GlobalThemeOverrides = { common: { - ...getNaiveThemeColors(colors, recommended), - borderRadius: '6px' + ...getNaiveThemeColors(colors, settings.recommendColor), + borderRadius: `${settings.themeRadius}px` }, LoadingBar: { colorLoading }, Tag: { - borderRadius: '6px' + borderRadius: `${settings.themeRadius}px` } }; diff --git a/src/theme/preset/azir.json b/src/theme/preset/azir.json index a30625ec..3b3d34b5 100644 --- a/src/theme/preset/azir.json +++ b/src/theme/preset/azir.json @@ -14,6 +14,7 @@ "warning": "#d4bb9d", "error": "#c49a9a" }, + "themeRadius": 8, "isInfoFollowPrimary": true, "layout": { "mode": "vertical-mix", diff --git a/src/theme/preset/compact.json b/src/theme/preset/compact.json index 46fc6628..99dd4751 100644 --- a/src/theme/preset/compact.json +++ b/src/theme/preset/compact.json @@ -14,6 +14,7 @@ "warning": "#faad14", "error": "#f5222d" }, + "themeRadius": 8, "isInfoFollowPrimary": true, "layout": { "mode": "vertical", diff --git a/src/theme/preset/dark.json b/src/theme/preset/dark.json index 367bba97..832f5902 100644 --- a/src/theme/preset/dark.json +++ b/src/theme/preset/dark.json @@ -14,6 +14,7 @@ "warning": "#faad14", "error": "#f5222d" }, + "themeRadius": 8, "isInfoFollowPrimary": true, "layout": { "mode": "vertical", diff --git a/src/theme/preset/default.json b/src/theme/preset/default.json index bcf97db8..69181e23 100644 --- a/src/theme/preset/default.json +++ b/src/theme/preset/default.json @@ -14,6 +14,7 @@ "warning": "#faad14", "error": "#f5222d" }, + "themeRadius": 8, "isInfoFollowPrimary": true, "layout": { "mode": "vertical", diff --git a/src/theme/settings.ts b/src/theme/settings.ts index 4a4e0a0a..ca50fcfd 100644 --- a/src/theme/settings.ts +++ b/src/theme/settings.ts @@ -5,6 +5,7 @@ export const themeSettings: App.Theme.ThemeSetting = { colourWeakness: false, recommendColor: false, themeColor: '#646cff', + themeRadius: 8, otherColor: { info: '#2080f0', success: '#52c41a', diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 33dbbdfe..ff2ca3e3 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -16,6 +16,8 @@ declare namespace App { recommendColor: boolean; /** Theme color */ themeColor: string; + /** Theme radius */ + themeRadius: number; /** Other color */ otherColor: OtherColor; /** Whether info color is followed by the primary color */ @@ -377,6 +379,9 @@ declare namespace App { } & Theme.ThemeColor; recommendColor: string; recommendColorDesc: string; + themeRadius: { + title: string; + }; preset: { title: string; apply: string; diff --git a/src/views/home/modules/card-data.vue b/src/views/home/modules/card-data.vue index 59104700..f1ff6d6f 100644 --- a/src/views/home/modules/card-data.vue +++ b/src/views/home/modules/card-data.vue @@ -1,6 +1,7 @@