mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 2f984aad710215f4e4684a035bb02f55d1a9e2cc (#9819)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-window::before {
|
||||
content: "\ea76"; /* Close icon flips between black dot and "X" for dirty windows */
|
||||
}
|
||||
@@ -3,6 +3,8 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/actions';
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import * as nls from 'vs/nls';
|
||||
@@ -157,6 +159,12 @@ export abstract class BaseSwitchWindow extends Action {
|
||||
tooltip: nls.localize('close', "Close Window")
|
||||
};
|
||||
|
||||
private readonly closeDirtyWindowAction: IQuickInputButton = {
|
||||
iconClass: 'dirty-window codicon-circle-filled',
|
||||
tooltip: nls.localize('close', "Close Window"),
|
||||
alwaysVisible: true
|
||||
};
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@@ -185,7 +193,7 @@ export abstract class BaseSwitchWindow extends Action {
|
||||
label: win.title,
|
||||
iconClasses: getIconClasses(this.modelService, this.modeService, resource, fileKind),
|
||||
description: (currentWindowId === win.id) ? nls.localize('current', "Current Window") : undefined,
|
||||
buttons: (!this.isQuickNavigate() && currentWindowId !== win.id) ? [this.closeWindowAction] : undefined
|
||||
buttons: currentWindowId !== win.id ? win.dirty ? [this.closeDirtyWindowAction] : [this.closeWindowAction] : undefined
|
||||
};
|
||||
});
|
||||
const autoFocusIndex = (picks.indexOf(picks.filter(pick => pick.payload === currentWindowId)[0]) + 1) % picks.length;
|
||||
|
||||
@@ -269,19 +269,17 @@ export class NativeWindow extends Disposable {
|
||||
}));
|
||||
}
|
||||
|
||||
// Document edited (macOS only): indicate for dirty working copies
|
||||
if (isMacintosh) {
|
||||
this._register(this.workingCopyService.onDidChangeDirty(workingCopy => {
|
||||
const gotDirty = workingCopy.isDirty();
|
||||
if (gotDirty && !(workingCopy.capabilities & WorkingCopyCapabilities.Untitled) && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) {
|
||||
return; // do not indicate dirty of working copies that are auto saved after short delay
|
||||
}
|
||||
// Document edited: indicate for dirty working copies
|
||||
this._register(this.workingCopyService.onDidChangeDirty(workingCopy => {
|
||||
const gotDirty = workingCopy.isDirty();
|
||||
if (gotDirty && !(workingCopy.capabilities & WorkingCopyCapabilities.Untitled) && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) {
|
||||
return; // do not indicate dirty of working copies that are auto saved after short delay
|
||||
}
|
||||
|
||||
this.updateDocumentEdited(gotDirty);
|
||||
}));
|
||||
this.updateDocumentEdited(gotDirty);
|
||||
}));
|
||||
|
||||
this.updateDocumentEdited();
|
||||
}
|
||||
this.updateDocumentEdited();
|
||||
|
||||
// Detect minimize / maximize
|
||||
this._register(Event.any(
|
||||
|
||||
Reference in New Issue
Block a user