From 6b2bad1fb6dc3fe633b4e2c4e2ff6830f4c3d2cf Mon Sep 17 00:00:00 2001
From: naskya <m@naskya.net>
Date: Thu, 15 Feb 2024 13:10:24 +0900
Subject: [PATCH] feat (client): separate settings for displaying rounded
 avatars for cat and non-cat accounts

---
 docs/changelog.md                                  | 4 ++++
 locales/en-US.yml                                  | 3 ++-
 locales/ja-JP.yml                                  | 3 ++-
 packages/client/src/components/global/MkAvatar.vue | 8 ++++++--
 packages/client/src/pages/settings/general.vue     | 6 ++++++
 packages/client/src/store.ts                       | 4 ++++
 6 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/docs/changelog.md b/docs/changelog.md
index 3bed8b3ef8..fd487d4a31 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -1,3 +1,7 @@
+# Unreleased
+
+- separate settings for displaying rounded avatars for cat and non-cat accounts
+
 # v20240214
 
 - fix container images
diff --git a/locales/en-US.yml b/locales/en-US.yml
index e6d59a0862..1bee956eba 100644
--- a/locales/en-US.yml
+++ b/locales/en-US.yml
@@ -906,7 +906,8 @@ customCssWarn: "This setting should only be used if you know what it does. Enter
   improper values may cause the client to stop functioning normally."
 global: "Global"
 recommended: "Recommended"
-squareAvatars: "Display squared avatars"
+squareAvatars: "Display squared avatars for non-cat accounts"
+squareCatAvatars: "Display squared avatars for cat accounts"
 seperateRenoteQuote: "Separate boost and quote buttons"
 sent: "Sent"
 received: "Received"
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index bc0c92900d..4bb65fa86d 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -820,7 +820,8 @@ customCss: "カスタムCSS"
 customCssWarn: "この設定は必ず知識のある方が行ってください。不適切な設定を行うとクライアントが正常に使用できなくなる恐れがあります。"
 global: "グローバル"
 recommended: "推奨"
-squareAvatars: "アイコンを四角形で表示"
+squareAvatars: "猫でないアカウントのアイコンを四角形で表示"
+squareCatAvatars: "猫のアカウントのアイコンを四角形で表示"
 seperateRenoteQuote: "ブーストと引用のボタンを分ける"
 sent: "送信"
 received: "受信"
diff --git a/packages/client/src/components/global/MkAvatar.vue b/packages/client/src/components/global/MkAvatar.vue
index b359084602..fc9ae75f8f 100644
--- a/packages/client/src/components/global/MkAvatar.vue
+++ b/packages/client/src/components/global/MkAvatar.vue
@@ -24,7 +24,9 @@
 		class="eiwwqkts _noSelect showLightBox"
 		:class="{
 			cat: user.isCat,
-			square: defaultStore.state.squareAvatars,
+			square: user.isCat
+				? defaultStore.state.squareCatAvatars
+				: defaultStore.state.squareAvatars,
 		}"
 		:style="{ color }"
 		:title="acct.toString(user)"
@@ -44,7 +46,9 @@
 		class="eiwwqkts _noSelect"
 		:class="{
 			cat: user.isCat,
-			square: defaultStore.state.squareAvatars,
+			square: user.isCat
+				? defaultStore.state.squareCatAvatars
+				: defaultStore.state.squareAvatars,
 		}"
 		:style="{ color }"
 		:to="userPage(user)"
diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue
index 2b97cf1de9..c3f83862fd 100644
--- a/packages/client/src/pages/settings/general.vue
+++ b/packages/client/src/pages/settings/general.vue
@@ -236,6 +236,9 @@
 			<FormSwitch v-model="squareAvatars" class="_formBlock">{{
 				i18n.ts.squareAvatars
 			}}</FormSwitch>
+			<FormSwitch v-model="squareCatAvatars" class="_formBlock">{{
+				i18n.ts.squareCatAvatars
+			}}</FormSwitch>
 			<FormSwitch v-model="seperateRenoteQuote" class="_formBlock">{{
 				i18n.ts.seperateRenoteQuote
 			}}</FormSwitch>
@@ -419,6 +422,9 @@ const seperateRenoteQuote = computed(
 	defaultStore.makeGetterSetter("seperateRenoteQuote"),
 );
 const squareAvatars = computed(defaultStore.makeGetterSetter("squareAvatars"));
+const squareCatAvatars = computed(
+	defaultStore.makeGetterSetter("squareCatAvatars"),
+);
 const showUpdates = computed(defaultStore.makeGetterSetter("showUpdates"));
 const swipeOnDesktop = computed(
 	defaultStore.makeGetterSetter("swipeOnDesktop"),
diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts
index eef003ae57..3a11e765e7 100644
--- a/packages/client/src/store.ts
+++ b/packages/client/src/store.ts
@@ -292,6 +292,10 @@ export const defaultStore = markRaw(
 			where: "device",
 			default: true,
 		},
+		squareCatAvatars: {
+			where: "device",
+			default: false,
+		},
 		postFormWithHashtags: {
 			where: "device",
 			default: false,