From ad6201e664065fc37caa6b66ea30e04ece829138 Mon Sep 17 00:00:00 2001 From: ayang <473033518@qq.com> Date: Wed, 20 Nov 2024 10:12:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20`=E5=89=AA?= =?UTF-8?q?=E8=B4=B4=E6=9D=BF=20>=20=E7=AA=97=E5=8F=A3=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=20>=20=E6=BF=80=E6=B4=BB=E6=97=B6=E5=88=87=E6=8D=A2=E8=87=B3?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E5=88=86=E7=BB=84`=20=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.json | 3 ++- src/locales/ja-JP.json | 3 ++- src/locales/zh-CN.json | 3 ++- src/locales/zh-TW.json | 3 ++- src/pages/Clipboard/Panel/components/Group/index.tsx | 8 ++++++++ src/pages/Clipboard/Settings/index.tsx | 8 ++++++++ src/stores/clipboard.ts | 1 + src/types/store.d.ts | 1 + 8 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 16d0ec7761..7d01d68495 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -19,7 +19,8 @@ "window_position_remember": "Remember Position", "window_position_follow": "Follow Mouse Cursor", "window_position_center": "Center on Screen", - "back_top": "Back to top when activated" + "back_top": "Back to top when activated", + "show_all": "Switch to all group when activated" }, "hints": { "back_top": "When the window is activated, scroll to the top and check the first item" diff --git a/src/locales/ja-JP.json b/src/locales/ja-JP.json index 524260a77f..cde150f80b 100644 --- a/src/locales/ja-JP.json +++ b/src/locales/ja-JP.json @@ -19,7 +19,8 @@ "window_position_remember": "位置を記憶する", "window_position_follow": "マウスに従う", "window_position_center": "スクリーンセンター", - "back_top": "トップページに戻る" + "back_top": "トップページに戻る", + "show_all": "起動時に全グループに切り替わる" }, "hints": { "back_top": "ウィンドウがアクティブになったら、一番上までスクロールし、最初のバーを選択する。" diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index be9d4f9053..8e132c2a45 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -19,7 +19,8 @@ "window_position_remember": "记住位置", "window_position_follow": "跟随鼠标", "window_position_center": "屏幕中心", - "back_top": "激活时回到顶部" + "back_top": "激活时回到顶部", + "show_all": "激活时切换至全部分组" }, "hints": { "back_top": "激活窗口时,滚动至顶部并选中首条" diff --git a/src/locales/zh-TW.json b/src/locales/zh-TW.json index bfe63765d8..35ce737bb6 100644 --- a/src/locales/zh-TW.json +++ b/src/locales/zh-TW.json @@ -19,7 +19,8 @@ "window_position_remember": "記住位置", "window_position_follow": "跟隨滑鼠", "window_position_center": "螢幕中央", - "back_top": "啟動時回到頂部" + "back_top": "啟動時回到頂部", + "show_all": "啟動時切換至全部分組" }, "hints": { "back_top": "啟動視窗時,滾動至頂部並選中首條" diff --git a/src/pages/Clipboard/Panel/components/Group/index.tsx b/src/pages/Clipboard/Panel/components/Group/index.tsx index 14c36320a0..ca971f38f5 100644 --- a/src/pages/Clipboard/Panel/components/Group/index.tsx +++ b/src/pages/Clipboard/Panel/components/Group/index.tsx @@ -42,6 +42,14 @@ const Group = () => { const [checked, setChecked] = useState(groupList[0].key); + useTauriFocus({ + onFocus() { + if (!clipboardStore.window.showAll) return; + + handleChange(groupList[0]); + }, + }); + const handleChange = (item: GroupItem) => { const { key, group, favorite } = item; diff --git a/src/pages/Clipboard/Settings/index.tsx b/src/pages/Clipboard/Settings/index.tsx index 8ea79792c3..7faacebd1e 100644 --- a/src/pages/Clipboard/Settings/index.tsx +++ b/src/pages/Clipboard/Settings/index.tsx @@ -24,6 +24,14 @@ const ClipboardSettings = () => { clipboardStore.window.backTop = value; }} /> + + { + clipboardStore.window.showAll = value; + }} + /> diff --git a/src/stores/clipboard.ts b/src/stores/clipboard.ts index 5f7dcee8c7..90c49a3c29 100644 --- a/src/stores/clipboard.ts +++ b/src/stores/clipboard.ts @@ -6,6 +6,7 @@ export const clipboardStore = proxy({ style: "float", position: "remember", backTop: false, + showAll: false, }, audio: { diff --git a/src/types/store.d.ts b/src/types/store.d.ts index 8e6b0b22c7..0f1365ee3a 100644 --- a/src/types/store.d.ts +++ b/src/types/store.d.ts @@ -58,6 +58,7 @@ export interface ClipboardStore { style: "float" | "dock"; position: "remember" | "follow" | "center"; backTop: boolean; + showAll: boolean; }; // 音效设置