diff --git a/locales/en-US.yml b/locales/en-US.yml index e8e3497f87..3bb8739f19 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -507,6 +507,7 @@ createAccount: "Create account" existingAccount: "Existing account" regenerate: "Regenerate" fontSize: "Font size" +cornerRadius: "Corner roundness" mediaListWithOneImageAppearance: "Height of media lists with one image only" limitTo: "Limit to {x}" noFollowRequests: "You don't have any pending follow requests" diff --git a/locales/index.d.ts b/locales/index.d.ts index 1c1105cb84..b2dec3e58b 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -510,6 +510,7 @@ export interface Locale { "existingAccount": string; "regenerate": string; "fontSize": string; + "cornerRadius": string; "mediaListWithOneImageAppearance": string; "limitTo": string; "noFollowRequests": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 68a6ca2daf..c49de02b1a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -507,6 +507,7 @@ createAccount: "アカウントを作成" existingAccount: "既存のアカウント" regenerate: "再生成" fontSize: "フォントサイズ" +cornerRadius: "コーナーの丸み" mediaListWithOneImageAppearance: "画像が1枚のみのメディアリストの高さ" limitTo: "{x}を上限に" noFollowRequests: "フォロー申請はありません" diff --git a/packages/backend/src/server/web/boot.js b/packages/backend/src/server/web/boot.js index 570b15da03..19c23af32a 100644 --- a/packages/backend/src/server/web/boot.js +++ b/packages/backend/src/server/web/boot.js @@ -132,6 +132,11 @@ document.documentElement.classList.add('f-' + fontSize); } + const cornerRadius = localStorage.getItem('cornerRadius'); + if (cornerRadius) { + document.documentElement.classList.add(`radius-${cornerRadius}`); + } + const useSystemFont = localStorage.getItem('useSystemFont'); if (useSystemFont) { document.documentElement.classList.add('useSystemFont'); diff --git a/packages/frontend/src/local-storage.ts b/packages/frontend/src/local-storage.ts index 0d73885b68..3023471b14 100644 --- a/packages/frontend/src/local-storage.ts +++ b/packages/frontend/src/local-storage.ts @@ -21,6 +21,7 @@ type Keys = 'colorScheme' | 'useSystemFont' | 'fontSize' | + 'cornerRadius' | 'ui' | 'ui_temp' | 'locale' | diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 05ff430915..22c24bec1c 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -142,6 +142,12 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + + @@ -212,6 +218,7 @@ import { claimAchievement } from '@/scripts/achievements.js'; const lang = ref(miLocalStorage.getItem('lang')); const fontSize = ref(miLocalStorage.getItem('fontSize')); +const cornerRadius = ref(miLocalStorage.getItem('cornerRadius')); const useSystemFont = ref(miLocalStorage.getItem('useSystemFont') != null); async function reloadAsk() { @@ -277,6 +284,14 @@ watch(fontSize, () => { } }); +watch(cornerRadius, () => { + if (cornerRadius.value == null) { + miLocalStorage.removeItem('cornerRadius'); + } else { + miLocalStorage.setItem('cornerRadius', cornerRadius.value); + } +}); + watch(useSystemFont, () => { if (useSystemFont.value) { miLocalStorage.setItem('useSystemFont', 't'); @@ -288,6 +303,7 @@ watch(useSystemFont, () => { watch([ lang, fontSize, + cornerRadius, useSystemFont, enableInfiniteScroll, squareAvatars, diff --git a/packages/frontend/src/pages/settings/preferences-backups.vue b/packages/frontend/src/pages/settings/preferences-backups.vue index b347d9555e..ecb7c68f73 100644 --- a/packages/frontend/src/pages/settings/preferences-backups.vue +++ b/packages/frontend/src/pages/settings/preferences-backups.vue @@ -114,6 +114,7 @@ type Profile = { hot: Record; cold: Record; fontSize: string | null; + cornerRadius: string | null; useSystemFont: 't' | null; wallpaper: string | null; }; @@ -171,6 +172,7 @@ function getSettings(): Profile['settings'] { hot, cold, fontSize: miLocalStorage.getItem('fontSize'), + cornerRadius: miLocalStorage.getItem('cornerRadius'), useSystemFont: miLocalStorage.getItem('useSystemFont') as 't' | null, wallpaper: miLocalStorage.getItem('wallpaper'), }; @@ -284,6 +286,13 @@ async function applyProfile(id: string): Promise { miLocalStorage.removeItem('fontSize'); } + // cornerRadius + if (settings.cornerRadius) { + miLocalStorage.setItem('cornerRadius', settings.cornerRadius); + } else { + miLocalStorage.removeItem('cornerRadius'); + } + // useSystemFont if (settings.useSystemFont) { miLocalStorage.setItem('useSystemFont', settings.useSystemFont);