Skip to content

Commit 513adf5

Browse files
authored
aux window - show lock icon in main window if locked (#200520)
1 parent 46a2336 commit 513adf5

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/vs/workbench/browser/parts/editor/editor.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ if (isMacintosh) {
345345
// Empty Editor Group Toolbar
346346
MenuRegistry.appendMenuItem(MenuId.EmptyEditorGroup, { command: { id: LOCK_GROUP_COMMAND_ID, title: localize('lockGroupAction', "Lock Group"), icon: Codicon.unlock }, group: 'navigation', order: 10, when: ContextKeyExpr.and(IsAuxiliaryEditorPartContext, ActiveEditorGroupLockedContext.toNegated()) });
347347
MenuRegistry.appendMenuItem(MenuId.EmptyEditorGroup, { command: { id: UNLOCK_GROUP_COMMAND_ID, title: localize('unlockGroupAction', "Unlock Group"), icon: Codicon.lock, toggled: ContextKeyExpr.true() }, group: 'navigation', order: 10, when: ActiveEditorGroupLockedContext });
348-
MenuRegistry.appendMenuItem(MenuId.EmptyEditorGroup, { command: { id: CLOSE_EDITOR_GROUP_COMMAND_ID, title: localize('closeGroupAction', "Close Group"), icon: Codicon.close }, group: 'navigation', order: 20 });
348+
MenuRegistry.appendMenuItem(MenuId.EmptyEditorGroup, { command: { id: CLOSE_EDITOR_GROUP_COMMAND_ID, title: localize('closeGroupAction', "Close Group"), icon: Codicon.close }, group: 'navigation', order: 20, when: ContextKeyExpr.or(IsAuxiliaryEditorPartContext, EditorPartMultipleEditorGroupsContext) });
349349

350350
// Empty Editor Group Context Menu
351351
MenuRegistry.appendMenuItem(MenuId.EmptyEditorGroupContext, { command: { id: SPLIT_EDITOR_UP, title: localize('splitUp', "Split Up") }, group: '2_split', order: 10 });

src/vs/workbench/browser/parts/editor/editorAutoSave.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class EditorAutoSave extends Disposable implements IWorkbenchContribution
9797
editorIdentifier.editor.isReadonly() ||
9898
editorIdentifier.editor.hasCapability(EditorInputCapabilities.Untitled)
9999
) {
100-
return; // no auto save for readonly or untitled editors
100+
return; // no auto save for non-dirty, readonly or untitled editors
101101
}
102102

103103
// Determine if we need to save all. In case of a window focus change we also save if

src/vs/workbench/browser/parts/editor/editorGroupView.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
172172
this.scopedContextKeyService = this._register(this.contextKeyService.createScoped(this.element));
173173

174174
// Container
175-
this.element.classList.add('editor-group-container');
175+
this.element.classList.add(...coalesce(['editor-group-container', this.model.isLocked ? 'locked' : undefined]));
176176

177177
// Container listeners
178178
this.registerContainerListeners();
@@ -548,6 +548,10 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
548548

549549
// Handle within
550550

551+
if (e.kind === GroupModelChangeKind.GROUP_LOCKED) {
552+
this.element.classList.toggle('locked', this.isLocked);
553+
}
554+
551555
if (!e.editor) {
552556
return;
553557
}

src/vs/workbench/browser/parts/editor/media/editorgroupview.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@
161161
height: 35px;
162162
}
163163

164+
.monaco-workbench .part.editor > .content .editor-group-container.empty.locked > .editor-group-container-toolbar,
164165
.monaco-workbench .part.editor > .content:not(.empty) .editor-group-container.empty > .editor-group-container-toolbar,
165166
.monaco-workbench .part.editor > .content.auxiliary .editor-group-container.empty > .editor-group-container-toolbar {
166-
display: block; /* show toolbar when more than one editor group or always when auxiliary */
167+
display: block; /* show toolbar when more than one editor group or always when auxiliary or locked */
167168
}
168169

169170
.monaco-workbench .part.editor > .content .editor-group-container > .editor-group-container-toolbar .actions-container {

0 commit comments

Comments
 (0)