Skip to content

Commit

Permalink
try hybrid model for editor features menu (microsoft#164493)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbatten authored and formigoni committed Oct 27, 2022
1 parent 3ba533d commit 5be6e53
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 22 deletions.
Expand Up @@ -28,7 +28,7 @@ export class ToggleStickyScroll extends Action2 {
},
menu: [
{ id: MenuId.CommandPalette },
{ id: MenuId.MenubarEditorFeaturesMenu, order: 6 },
{ id: MenuId.MenubarViewMenu, group: '5_editor', order: 2 },
{ id: MenuId.StickyScrollContext }
]
});
Expand Down
1 change: 0 additions & 1 deletion src/vs/platform/actions/common/actions.ts
Expand Up @@ -82,7 +82,6 @@ export class MenuId {
static readonly MenubarGoMenu = new MenuId('MenubarGoMenu');
static readonly MenubarHelpMenu = new MenuId('MenubarHelpMenu');
static readonly MenubarLayoutMenu = new MenuId('MenubarLayoutMenu');
static readonly MenubarEditorFeaturesMenu = new MenuId('MenubarEditorFeaturesMenu');
static readonly MenubarNewBreakpointMenu = new MenuId('MenubarNewBreakpointMenu');
static readonly MenubarPanelAlignmentMenu = new MenuId('MenubarPanelAlignmentMenu');
static readonly MenubarPanelPositionMenu = new MenuId('MenubarPanelPositionMenu');
Expand Down
Expand Up @@ -515,7 +515,7 @@ registerAction2(class ToggleBreadcrumb extends Action2 {
},
menu: [
{ id: MenuId.CommandPalette },
{ id: MenuId.MenubarEditorFeaturesMenu, order: 3 },
{ id: MenuId.MenubarAppearanceMenu, group: '4_editor', order: 2 },
{ id: MenuId.NotebookToolbar, group: 'notebookLayout', order: 2 },
{ id: MenuId.StickyScrollContext }
]
Expand Down
8 changes: 0 additions & 8 deletions src/vs/workbench/browser/parts/editor/editor.contribution.ts
Expand Up @@ -779,14 +779,6 @@ MenuRegistry.appendMenuItem(MenuId.MenubarLayoutMenu, {
order: 9
});

// Features menu
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
group: '2_appearance',
title: localize({ key: 'miEditorFeatures', comment: ['&& denotes a mnemonic'] }, "Editor &&Features"),
submenu: MenuId.MenubarEditorFeaturesMenu,
order: 3
});

// Main Menu Bar Contributions:

MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
Expand Down
5 changes: 3 additions & 2 deletions src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts
Expand Up @@ -26,8 +26,9 @@ export class ToggleMinimapAction extends Action2 {
f1: true,
toggled: ContextKeyExpr.equals('config.editor.minimap.enabled', true),
menu: {
id: MenuId.MenubarEditorFeaturesMenu,
order: 2
id: MenuId.MenubarAppearanceMenu,
group: '4_editor',
order: 1
}
});
}
Expand Down
Expand Up @@ -26,8 +26,9 @@ export class ToggleRenderControlCharacterAction extends Action2 {
f1: true,
toggled: ContextKeyExpr.equals('config.editor.renderControlCharacters', true),
menu: {
id: MenuId.MenubarEditorFeaturesMenu,
order: 5
id: MenuId.MenubarAppearanceMenu,
group: '4_editor',
order: 4
}
});
}
Expand Down
Expand Up @@ -26,8 +26,9 @@ class ToggleRenderWhitespaceAction extends Action2 {
f1: true,
toggled: ContextKeyExpr.notEquals('config.editor.renderWhitespace', 'none'),
menu: {
id: MenuId.MenubarEditorFeaturesMenu,
order: 4
id: MenuId.MenubarAppearanceMenu,
group: '4_editor',
order: 3
}
});
}
Expand Down
5 changes: 3 additions & 2 deletions src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.ts
Expand Up @@ -349,12 +349,13 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {


// View menu
MenuRegistry.appendMenuItem(MenuId.MenubarEditorFeaturesMenu, {
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
command: {
id: TOGGLE_WORD_WRAP_ID,
title: nls.localize({ key: 'miToggleWordWrap', comment: ['&& denotes a mnemonic'] }, "&&Word Wrap"),
toggled: EDITOR_WORD_WRAP,
precondition: CAN_TOGGLE_WORD_WRAP
},
order: 1
order: 1,
group: '5_editor'
});
6 changes: 3 additions & 3 deletions src/vs/workbench/electron-sandbox/actions/windowActions.ts
Expand Up @@ -104,7 +104,7 @@ export class ZoomInAction extends BaseZoomAction {
},
menu: {
id: MenuId.MenubarAppearanceMenu,
group: '3_zoom',
group: '5_zoom',
order: 1
}
});
Expand Down Expand Up @@ -138,7 +138,7 @@ export class ZoomOutAction extends BaseZoomAction {
},
menu: {
id: MenuId.MenubarAppearanceMenu,
group: '3_zoom',
group: '5_zoom',
order: 2
}
});
Expand Down Expand Up @@ -167,7 +167,7 @@ export class ZoomResetAction extends BaseZoomAction {
},
menu: {
id: MenuId.MenubarAppearanceMenu,
group: '3_zoom',
group: '5_zoom',
order: 3
}
});
Expand Down

0 comments on commit 5be6e53

Please sign in to comment.