re #128549
This commit is contained in:
parent
717181a9d8
commit
f0edba3e02
|
@ -2065,12 +2065,6 @@ registerAction2(class NotebookConfigureLayoutAction extends Action2 {
|
|||
f1: true,
|
||||
category: NOTEBOOK_ACTIONS_CATEGORY,
|
||||
menu: [
|
||||
{
|
||||
id: MenuId.NotebookEditorLayoutConfigure,
|
||||
group: 'notebookLayout',
|
||||
when: NOTEBOOK_IS_ACTIVE_EDITOR,
|
||||
order: 1
|
||||
},
|
||||
{
|
||||
id: MenuId.NotebookToolbar,
|
||||
group: 'notebookLayout',
|
||||
|
@ -2085,6 +2079,28 @@ registerAction2(class NotebookConfigureLayoutAction extends Action2 {
|
|||
}
|
||||
});
|
||||
|
||||
registerAction2(class NotebookConfigureLayoutFromEditorTitle extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.notebook.layout.configure.editorTitle',
|
||||
title: localize('workbench.notebook.layout.configure.label', "Customize Notebook Layout"),
|
||||
f1: true,
|
||||
category: NOTEBOOK_ACTIONS_CATEGORY,
|
||||
menu: [
|
||||
{
|
||||
id: MenuId.NotebookEditorLayoutConfigure,
|
||||
group: 'notebookLayout',
|
||||
when: NOTEBOOK_IS_ACTIVE_EDITOR,
|
||||
order: 1
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
run(accessor: ServicesAccessor): void {
|
||||
accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@tag:notebookLayout' });
|
||||
}
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
submenu: MenuId.NotebookEditorLayoutConfigure,
|
||||
rememberDefaultAction: false,
|
||||
|
@ -2095,13 +2111,70 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|||
when: NOTEBOOK_IS_ACTIVE_EDITOR
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.NotebookEditorLayoutConfigure, {
|
||||
command: {
|
||||
id: 'breadcrumbs.toggle',
|
||||
title: { value: localize('cmd.toggle', "Toggle Breadcrumbs"), original: 'Toggle Breadcrumbs' },
|
||||
},
|
||||
group: 'notebookLayoutDetails',
|
||||
order: 2
|
||||
registerAction2(class ToggleLineNumberFromEditorTitle extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'notebook.toggleLineNumbersFromEditorTitle',
|
||||
title: { value: localize('notebook.toggleLineNumbers', "Toggle Notebook Line Numbers"), original: 'Toggle Notebook Line Numbers' },
|
||||
precondition: NOTEBOOK_EDITOR_FOCUSED,
|
||||
menu: [
|
||||
{
|
||||
id: MenuId.NotebookEditorLayoutConfigure,
|
||||
group: 'notebookLayoutDetails',
|
||||
order: 1,
|
||||
when: NOTEBOOK_IS_ACTIVE_EDITOR
|
||||
}],
|
||||
category: NOTEBOOK_ACTIONS_CATEGORY,
|
||||
f1: true,
|
||||
toggled: {
|
||||
condition: ContextKeyExpr.notEquals('config.notebook.lineNumbers', 'off'),
|
||||
title: { value: localize('notebook.showLineNumbers', "Show Notebook Line Numbers"), original: 'Show Notebook Line Numbers' },
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async run(accessor: ServicesAccessor): Promise<void> {
|
||||
return accessor.get(ICommandService).executeCommand('notebook.toggleLineNumbers');
|
||||
}
|
||||
});
|
||||
|
||||
registerAction2(class ToggleCellToolbarPositionFromEditorTitle extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'notebook.toggleCellToolbarPositionFromEditorTitle',
|
||||
title: { value: localize('notebook.toggleCellToolbarPosition', "Toggle Cell Toolbar Position"), original: 'Toggle Cell Toolbar Position' },
|
||||
menu: [{
|
||||
id: MenuId.NotebookEditorLayoutConfigure,
|
||||
group: 'notebookLayoutDetails',
|
||||
order: 3
|
||||
}],
|
||||
category: NOTEBOOK_ACTIONS_CATEGORY,
|
||||
f1: false
|
||||
});
|
||||
}
|
||||
|
||||
async run(accessor: ServicesAccessor, ...args: any[]): Promise<void> {
|
||||
return accessor.get(ICommandService).executeCommand('notebook.toggleCellToolbarPosition', ...args);
|
||||
}
|
||||
});
|
||||
|
||||
registerAction2(class ToggleBreadcrumbFromEditorTitle extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'breadcrumbs.toggleFromEditorTitle',
|
||||
title: { value: localize('notebook.toggleBreadcrumb', "Toggle Breadcrumbs"), original: 'Toggle Breadcrumbs' },
|
||||
menu: [{
|
||||
id: MenuId.NotebookEditorLayoutConfigure,
|
||||
group: 'notebookLayoutDetails',
|
||||
order: 2
|
||||
}],
|
||||
f1: false
|
||||
});
|
||||
}
|
||||
|
||||
async run(accessor: ServicesAccessor): Promise<void> {
|
||||
return accessor.get(ICommandService).executeCommand('breadcrumbs.toggle');
|
||||
}
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
||||
|
|
|
@ -21,10 +21,6 @@ export class ToggleCellToolbarPositionAction extends Action2 {
|
|||
id: MenuId.NotebookCellTitle,
|
||||
group: 'View',
|
||||
order: 1
|
||||
}, {
|
||||
id: MenuId.NotebookEditorLayoutConfigure,
|
||||
group: 'notebookLayoutDetails',
|
||||
order: 3
|
||||
}],
|
||||
category: NOTEBOOK_ACTIONS_CATEGORY,
|
||||
f1: false
|
||||
|
|
|
@ -14,8 +14,10 @@ import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'v
|
|||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ActiveEditorContext } from 'vs/workbench/common/editor';
|
||||
import { NOTEBOOK_ACTIONS_CATEGORY } from 'vs/workbench/contrib/notebook/browser/contrib/coreActions';
|
||||
import { getNotebookEditorFromEditorPane, ICellViewModel, INotebookEditor, NOTEBOOK_CELL_LINE_NUMBERS, NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_IS_ACTIVE_EDITOR } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||
import { getNotebookEditorFromEditorPane, ICellViewModel, INotebookEditor, NOTEBOOK_CELL_LINE_NUMBERS, NOTEBOOK_EDITOR_FOCUSED } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||
import { NotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookEditor';
|
||||
import { NotebookCellInternalMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { NotebookOptions } from 'vs/workbench/contrib/notebook/common/notebookOptions';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
|
@ -161,12 +163,6 @@ registerAction2(class ToggleLineNumberAction extends Action2 {
|
|||
title: { value: localize('notebook.toggleLineNumbers', "Toggle Notebook Line Numbers"), original: 'Toggle Notebook Line Numbers' },
|
||||
precondition: NOTEBOOK_EDITOR_FOCUSED,
|
||||
menu: [
|
||||
{
|
||||
id: MenuId.NotebookEditorLayoutConfigure,
|
||||
group: 'notebookLayoutDetails',
|
||||
order: 1,
|
||||
when: NOTEBOOK_IS_ACTIVE_EDITOR
|
||||
},
|
||||
{
|
||||
id: MenuId.NotebookToolbar,
|
||||
group: 'notebookLayout',
|
||||
|
@ -199,7 +195,7 @@ registerAction2(class ToggleActiveLineNumberAction extends Action2 {
|
|||
super({
|
||||
id: 'notebook.cell.toggleLineNumbers',
|
||||
title: 'Show Cell Line Numbers',
|
||||
precondition: NOTEBOOK_EDITOR_FOCUSED,
|
||||
precondition: ActiveEditorContext.isEqualTo(NotebookEditor.ID),
|
||||
menu: [{
|
||||
id: MenuId.NotebookCellTitle,
|
||||
group: 'View',
|
||||
|
|
Loading…
Reference in a new issue