Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 新增 剪贴板 > 窗口设置 > 激活时切换至全部分组 的配置项 #824

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"window_position_remember": "位置を記憶する",
"window_position_follow": "マウスに従う",
"window_position_center": "スクリーンセンター",
"back_top": "トップページに戻る"
"back_top": "トップページに戻る",
"show_all": "起動時に全グループに切り替わる"
},
"hints": {
"back_top": "ウィンドウがアクティブになったら、一番上までスクロールし、最初のバーを選択する。"
Expand Down
3 changes: 2 additions & 1 deletion src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"window_position_remember": "记住位置",
"window_position_follow": "跟随鼠标",
"window_position_center": "屏幕中心",
"back_top": "激活时回到顶部"
"back_top": "激活时回到顶部",
"show_all": "激活时切换至全部分组"
},
"hints": {
"back_top": "激活窗口时,滚动至顶部并选中首条"
Expand Down
3 changes: 2 additions & 1 deletion src/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"window_position_remember": "記住位置",
"window_position_follow": "跟隨滑鼠",
"window_position_center": "螢幕中央",
"back_top": "啟動時回到頂部"
"back_top": "啟動時回到頂部",
"show_all": "啟動時切換至全部分組"
},
"hints": {
"back_top": "啟動視窗時,滾動至頂部並選中首條"
Expand Down
8 changes: 8 additions & 0 deletions src/pages/Clipboard/Panel/components/Group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 8 additions & 0 deletions src/pages/Clipboard/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ const ClipboardSettings = () => {
clipboardStore.window.backTop = value;
}}
/>

<ProSwitch
title={t("preference.clipboard.window_settings.label.show_all")}
value={window.showAll}
onChange={(value) => {
clipboardStore.window.showAll = value;
}}
/>
</ProList>

<ProList header={t("preference.clipboard.audio_settings.title")}>
Expand Down
1 change: 1 addition & 0 deletions src/stores/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const clipboardStore = proxy<ClipboardStore>({
style: "float",
position: "remember",
backTop: false,
showAll: false,
},

audio: {
Expand Down
1 change: 1 addition & 0 deletions src/types/store.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface ClipboardStore {
style: "float" | "dock";
position: "remember" | "follow" | "center";
backTop: boolean;
showAll: boolean;
};

// 音效设置
Expand Down