mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 14:59:59 +02:00
Refactor ZenKeyboardShortcuts to include split view shortcuts
This commit is contained in:
parent
72f6b8d513
commit
c65b4aef13
2 changed files with 50 additions and 3 deletions
|
@ -85,12 +85,13 @@ const fixedL10nIds = {
|
||||||
const ZEN_COMPACT_MODE_SHORTCUTS_GROUP = 'zen-compact-mode';
|
const ZEN_COMPACT_MODE_SHORTCUTS_GROUP = 'zen-compact-mode';
|
||||||
const ZEN_WORKSPACE_SHORTCUTS_GROUP = 'zen-workspace';
|
const ZEN_WORKSPACE_SHORTCUTS_GROUP = 'zen-workspace';
|
||||||
const ZEN_OTHER_SHORTCUTS_GROUP = 'zen-other';
|
const ZEN_OTHER_SHORTCUTS_GROUP = 'zen-other';
|
||||||
|
const ZEN_SPLIT_VIEW_SHORTCUTS_GROUP = 'zen-split-view';
|
||||||
const FIREFOX_SHORTCUTS_GROUP = 'zen-kbs-invalid';
|
const FIREFOX_SHORTCUTS_GROUP = 'zen-kbs-invalid';
|
||||||
const VALID_SHORTCUT_GROUPS = [
|
const VALID_SHORTCUT_GROUPS = [
|
||||||
ZEN_COMPACT_MODE_SHORTCUTS_GROUP,
|
ZEN_COMPACT_MODE_SHORTCUTS_GROUP,
|
||||||
ZEN_WORKSPACE_SHORTCUTS_GROUP,
|
ZEN_WORKSPACE_SHORTCUTS_GROUP,
|
||||||
ZEN_OTHER_SHORTCUTS_GROUP,
|
ZEN_SPLIT_VIEW_SHORTCUTS_GROUP,
|
||||||
'other', ...Object.keys(defaultKeyboardGroups)
|
...Object.keys(defaultKeyboardGroups), ZEN_OTHER_SHORTCUTS_GROUP, 'other'
|
||||||
];
|
];
|
||||||
|
|
||||||
class KeyShortcutModifiers {
|
class KeyShortcutModifiers {
|
||||||
|
@ -598,6 +599,52 @@ var gZenKeyboardShortcutsManager = {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Split view
|
||||||
|
newShortcutList.push(
|
||||||
|
new KeyShortcut(
|
||||||
|
'zen-split-view-grid',
|
||||||
|
'G',
|
||||||
|
'',
|
||||||
|
ZEN_SPLIT_VIEW_SHORTCUTS_GROUP,
|
||||||
|
KeyShortcutModifiers.fromObject({ctrl: true, alt: true}),
|
||||||
|
'code:gZenViewSplitter.toggleShortcut(\'grid\')',
|
||||||
|
'zen-split-view-shortcut-grid'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
newShortcutList.push(
|
||||||
|
new KeyShortcut(
|
||||||
|
'zen-split-view-vertical',
|
||||||
|
'V',
|
||||||
|
'',
|
||||||
|
ZEN_SPLIT_VIEW_SHORTCUTS_GROUP,
|
||||||
|
KeyShortcutModifiers.fromObject({ctrl: true, alt: true}),
|
||||||
|
'code:gZenViewSplitter.toggleShortcut(\'vsep\')',
|
||||||
|
'zen-split-view-shortcut-vertical'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
newShortcutList.push(
|
||||||
|
new KeyShortcut(
|
||||||
|
'zen-split-view-horizontal',
|
||||||
|
'H',
|
||||||
|
'',
|
||||||
|
ZEN_SPLIT_VIEW_SHORTCUTS_GROUP,
|
||||||
|
KeyShortcutModifiers.fromObject({ctrl: true, alt: true}),
|
||||||
|
'code:gZenViewSplitter.toggleShortcut(\'hsep\')',
|
||||||
|
'zen-split-view-shortcut-horizontal'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
newShortcutList.push(
|
||||||
|
new KeyShortcut(
|
||||||
|
'zen-split-view-unsplit',
|
||||||
|
'U',
|
||||||
|
'',
|
||||||
|
ZEN_SPLIT_VIEW_SHORTCUTS_GROUP,
|
||||||
|
KeyShortcutModifiers.fromObject({ctrl: true, alt: true}),
|
||||||
|
'code:gZenViewSplitter.toggleShortcut(\'unsplit\')',
|
||||||
|
'zen-split-view-shortcut-unsplit'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
return newShortcutList;
|
return newShortcutList;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ var gZenBrowserManagerSidebar = {
|
||||||
contextTab: null,
|
contextTab: null,
|
||||||
|
|
||||||
DEFAULT_MOBILE_USER_AGENT: 'Mozilla/5.0 (Android 12; Mobile; rv:129.0) Gecko/20100101 Firefox/130.0',
|
DEFAULT_MOBILE_USER_AGENT: 'Mozilla/5.0 (Android 12; Mobile; rv:129.0) Gecko/20100101 Firefox/130.0',
|
||||||
MAX_SIDEBAR_PANELS: 8, // +1 for the add panel button
|
MAX_SIDEBAR_PANELS: 9, // +1 for the add panel button
|
||||||
MAX_RUNS: 3,
|
MAX_RUNS: 3,
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue