Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,7 @@ zen-devtools-toggle-storage-shortcut = Toggle Storage
zen-devtools-toggle-dom-shortcut = Toggle DOM
zen-devtools-toggle-accessibility-shortcut = Toggle Accessibility
zen-close-all-unpinned-tabs-shortcut = Close All Unpinned Tabs
zen-tab-next-shortcut = Next Tab
zen-tab-previous-shortcut = Previous Tab
zen-move-tab-forward-shortcut = Move Tab Forward
zen-move-tab-backward-shortcut = Move Tab Backward
7 changes: 6 additions & 1 deletion src/browser/base/content/zen-commands.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,9 @@

<command id="cmd_zenTogglePinTab" />
<command id="cmd_zenCloseUnpinnedTabs" />
</commandset>

<command id="cmd_zenTabNext" />
<command id="cmd_zenTabPrevious" />
<command id="cmd_zenMoveTabForward" />
<command id="cmd_zenMoveTabBackward" />
</commandset>
12 changes: 12 additions & 0 deletions src/zen/common/zen-sets.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ document.addEventListener(
gZenWorkspaces.unloadWorkspace();
break;
}
case 'cmd_zenTabNext':
gBrowser.tabContainer.advanceSelectedTab(1, true);
break;
case 'cmd_zenTabPrevious':
gBrowser.tabContainer.advanceSelectedTab(-1, true);
break;
case 'cmd_zenMoveTabForward':
gBrowser.moveTabForward();
break;
case 'cmd_zenMoveTabBackward':
gBrowser.moveTabBackward();
break;
default:
gZenGlanceManager.handleMainCommandSet(event);
if (event.target.id.startsWith('cmd_zenWorkspaceSwitch')) {
Expand Down
55 changes: 54 additions & 1 deletion src/zen/kbs/ZenKeyboardShortcuts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const defaultKeyboardGroups = {
'zen-close-all-unpinned-tabs-shortcut',
'zen-close-tab-shortcut',
'zen-close-shortcut',
'zen-tab-next-shortcut',
'zen-tab-previous-shortcut',
'zen-move-tab-forward-shortcut',
'zen-move-tab-backward-shortcut',
'id:key_selectTab1',
'id:key_selectTab2',
'id:key_selectTab3',
Expand Down Expand Up @@ -800,7 +804,7 @@ class nsZenKeyboardShortcutsLoader {
}

class nsZenKeyboardShortcutsVersioner {
static LATEST_KBS_VERSION = 13;
static LATEST_KBS_VERSION = 14;

constructor() {}

Expand Down Expand Up @@ -1096,6 +1100,55 @@ class nsZenKeyboardShortcutsVersioner {
);
}

if (version < 14) {
// Migrate from version 13 to 14
// Add customizable tab navigation and move tab shortcuts
data.push(
new KeyShortcut(
'zen-tab-next',
'',
'VK_TAB',
'windowAndTabManagement',
nsKeyShortcutModifiers.fromObject({ accel: true }),
'cmd_zenTabNext',
'zen-tab-next-shortcut'
)
);
data.push(
new KeyShortcut(
'zen-tab-previous',
'',
'VK_TAB',
'windowAndTabManagement',
nsKeyShortcutModifiers.fromObject({ accel: true, shift: true }),
'cmd_zenTabPrevious',
'zen-tab-previous-shortcut'
)
);
data.push(
new KeyShortcut(
'zen-move-tab-forward',
'',
'',
'windowAndTabManagement',
nsKeyShortcutModifiers.fromObject({}),
'cmd_zenMoveTabForward',
'zen-move-tab-forward-shortcut'
)
);
data.push(
new KeyShortcut(
'zen-move-tab-backward',
'',
'',
'windowAndTabManagement',
nsKeyShortcutModifiers.fromObject({}),
'cmd_zenMoveTabBackward',
'zen-move-tab-backward-shortcut'
)
);
}

return data;
}
}
Expand Down