提交 c55d8a0e 编写于 作者: R rebornix

select notebook layout action.

上级 b2da4119
......@@ -1856,23 +1856,53 @@ registerAction2(class ExpandCellOuputAction extends ChangeNotebookCellMetadataAc
}
});
registerAction2(class NotebookConfigureLayoutAction extends Action2 {
constructor() {
super({
id: 'workbench.notebook.layout.select',
title: localize('workbench.notebook.layout.select.label', "Select Notebook Layout"),
f1: true,
category: NOTEBOOK_ACTIONS_CATEGORY,
menu: [
{
id: MenuId.EditorTitle,
group: 'notebookLayout',
when: ContextKeyExpr.notEquals('config.notebook.globalToolbar', true),
order: 0
},
{
id: MenuId.NotebookToolbar,
group: 'notebookLayout',
when: ContextKeyExpr.equals('config.notebook.globalToolbar', true),
order: 0
}
]
});
}
run(accessor: ServicesAccessor): void {
accessor.get(ICommandService).executeCommand('workbench.action.openWalkthrough', { category: 'Setup', step: 'notebookProfile' }, true);
}
});
registerAction2(class NotebookConfigureLayoutAction extends Action2 {
constructor() {
super({
id: 'workbench.notebook.layout.configure',
title: localize('workbench.notebook.layout.configure.label', "Configure Notebook Editor Layout Settings"),
title: localize('workbench.notebook.layout.configure.label', "Configure Notebook Layout Settings"),
f1: true,
category: NOTEBOOK_ACTIONS_CATEGORY,
menu: [
{
id: MenuId.EditorTitle,
group: 'notebookLayout',
when: ContextKeyExpr.notEquals('config.notebook.globalToolbar', true)
when: ContextKeyExpr.notEquals('config.notebook.globalToolbar', true),
order: 1
},
{
id: MenuId.NotebookToolbar,
group: 'notebookLayout',
when: ContextKeyExpr.equals('config.notebook.globalToolbar', true)
when: ContextKeyExpr.equals('config.notebook.globalToolbar', true),
order: 1
}
]
});
......
......@@ -72,7 +72,7 @@ export class CellEditorOptions extends Disposable {
const lineNumbers: LineNumbersType = renderLiNumbers ? 'on' : 'off';
const editorOptions = deepClone(this.configurationService.getValue<IEditorOptions>('editor', { overrideIdentifier: this.language }));
const editorOptionsOverrideRaw = this.notebookOptions.getLayoutConfiguration().editorOptionsCustomizations ?? {};
let editorOptionsOverride: { [key: string]: any } = {};
let editorOptionsOverride: { [key: string]: any; } = {};
for (let key in editorOptionsOverrideRaw) {
if (key.indexOf('editor.') === 0) {
editorOptionsOverride[key.substr(7)] = editorOptionsOverrideRaw[key];
......@@ -145,7 +145,7 @@ registerAction2(class ToggleLineNumberAction extends Action2 {
menu: [{
id: MenuId.EditorTitle,
group: 'notebookLayout',
order: 0,
order: 2,
when: ContextKeyExpr.and(
NOTEBOOK_IS_ACTIVE_EDITOR,
ContextKeyExpr.notEquals('config.notebook.globalToolbar', true)
......@@ -153,6 +153,7 @@ registerAction2(class ToggleLineNumberAction extends Action2 {
}, {
id: MenuId.NotebookToolbar,
group: 'notebookLayout',
order: 2,
when: ContextKeyExpr.equals('config.notebook.globalToolbar', true)
}],
category: NOTEBOOK_ACTIONS_CATEGORY,
......
......@@ -265,7 +265,7 @@ export const walkthroughs: GettingStartedWalkthroughContent = [
},
{
id: 'notebookProfile',
title: localize('gettingStarted.notebookProfile.title', "Customize the look of your notebooks"),
title: localize('gettingStarted.notebookProfile.title', "Select the layout for your notebooks"),
description: localize('gettingStarted.notebookProfile.description', "Get notebooks to feel just the way you prefer"),
when: 'userHasOpenedNotebook',
media: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册