Skip to content

Commit

Permalink
Add keyboard shortcut slots for "Toggle Tree Collapsed" and "Toggle T…
Browse files Browse the repository at this point in the history
…ree Collapsed Recursively" #3535
  • Loading branch information
piroor committed Apr 30, 2024
1 parent af0ed11 commit d2c09b9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webextensions/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"command_tabbarDown": { "message": "Scroll Tabs Down by Lines" },
"command_tabbarPageDown": { "message": "Scroll Tabs Down by Page" },
"command_tabbarEnd": { "message": "Scroll Tabs to End" },
"command_toggleTreeCollapsed": { "message": "Toggle Tree Collapsed" },
"command_toggleTreeCollapsedRecursively": { "message": "Toggle Tree Collapsed Recursively" },
"command_toggleSubPanel": { "message": "Toggle Sub Panel" },
"command_switchSubPanel": { "message": "Switch Sub Panel contents" },
"command_increaseSubPanel": { "message": "Increase Size of the Sub Panel" },
Expand Down
2 changes: 2 additions & 0 deletions webextensions/_locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"command_tabbarDown": { "message": "タブの一覧を数行下にスクロール" },
"command_tabbarPageDown": { "message": "タブの一覧を1ページ下にスクロール" },
"command_tabbarEnd": { "message": "タブの一覧を末尾までスクロール" },
"command_toggleTreeCollapsed": { "message": "ツリーの折りたたみ状態を切り替える" },
"command_toggleTreeCollapsedRecursively": { "message": "ツリーの折りたたみ状態を再帰的に切り替える" },
"command_toggleSubPanel": { "message": "サブパネルの表示・非表示を切り替える" },
"command_switchSubPanel": { "message": "サブパネルの内容を切り替える" },
"command_increaseSubPanel": { "message": "サブパネルの高さを広げる" },
Expand Down
13 changes: 13 additions & 0 deletions webextensions/background/handle-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,19 @@ async function onShortcutCommand(command) {
});
return;

case 'toggleTreeCollapsed':
if (activeTab.$TST.subtreeCollapsed)
Commands.expandTree(selectedTabs);
else
Commands.collapseTree(selectedTabs);
return;
case 'toggleTreeCollapsedRecursively':
if (activeTab.$TST.subtreeCollapsed)
Commands.expandTree(selectedTabs, { recursively: true });
else
Commands.collapseTree(selectedTabs, { recursively: true });
return;

case 'toggleSubPanel':
SidebarConnection.sendMessage({
type: Constants.kCOMMAND_TOGGLE_SUBPANEL,
Expand Down
6 changes: 6 additions & 0 deletions webextensions/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@
"expandAll": {
"description": "__MSG_context_expandAll_command__"
},
"toggleTreeCollapsed": {
"description": "__MSG_command_toggleTreeCollapsed__"
},
"toggleTreeCollapsedRecursively": {
"description": "__MSG_command_toggleTreeCollapsedRecursively__"
},
"bookmarkTree": {
"description": "__MSG_context_bookmarkTree_command__"
},
Expand Down

0 comments on commit d2c09b9

Please sign in to comment.