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; }; // 音效设置