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

Feature: Add shortcut to enable Rearrange View #3035

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
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
13 changes: 13 additions & 0 deletions src/browser/base/zen-components/ZenKeyboardShortcuts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,19 @@ class ZenKeyboardShortcutsVersioner {
// since it's not used anymore.
data = data.filter((shortcut) => shortcut.getID() != 'zen-toggle-sidebar');
}
if (version < 5) {
data.push(
new KeyShortcut(
'zen-split-view-rearrange',
'Z',
'',
ZEN_SPLIT_VIEW_SHORTCUTS_GROUP,
KeyShortcutModifiers.fromObject({ accel: true, alt: true }),
'code:gZenViewSplitter.enableTabRearrangeView()',
'zen-split-view-shortcut-rearrange'
)
);
}
return data;
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/browser/base/zen-components/ZenViewSplitter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
}

afterRearangeAction() {
document.getElementById("zenSplitViewModifier").hidePopup();
let splitViewMenu = document.getElementById("zenSplitViewModifier");
if (splitViewMenu) {
splitViewMenu.hidePopup();
}
ConfirmationHint.show(document.getElementById("zen-split-views-box"), "zen-split-view-modifier-enabled-toast", {
descriptionId: "zen-split-view-modifier-enabled-toast-description",
showDescription: true,
Expand All @@ -218,6 +221,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
}

enableTabRearrangeView() {
if (this.currentView < 0) return;
if (this.rearrangeViewEnabled) return;
this.rearrangeViewEnabled = true;
this.rearrangeViewView = this.currentView;
Expand Down