mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 09:10:30 -04:00
This reverts commit d15a3fcc98.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./watermark';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { isMacintosh, OS } from 'vs/base/common/platform';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
@@ -120,8 +120,9 @@ const folderEntries = [
|
||||
|
||||
const WORKBENCH_TIPS_ENABLED_KEY = 'workbench.tips.enabled';
|
||||
|
||||
export class WatermarkContribution extends Disposable implements IWorkbenchContribution {
|
||||
export class WatermarkContribution implements IWorkbenchContribution {
|
||||
|
||||
private toDispose: IDisposable[] = [];
|
||||
private watermark: HTMLElement;
|
||||
private enabled: boolean;
|
||||
private workbenchState: WorkbenchState;
|
||||
@@ -134,7 +135,6 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IEditorGroupsService private readonly editorGroupsService: IEditorGroupsService
|
||||
) {
|
||||
super();
|
||||
this.workbenchState = contextService.getWorkbenchState();
|
||||
|
||||
lifecycleService.onShutdown(this.dispose, this);
|
||||
@@ -142,7 +142,7 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
|
||||
if (this.enabled) {
|
||||
this.create();
|
||||
}
|
||||
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
||||
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration(WORKBENCH_TIPS_ENABLED_KEY)) {
|
||||
const enabled = this.configurationService.getValue<boolean>(WORKBENCH_TIPS_ENABLED_KEY);
|
||||
if (enabled !== this.enabled) {
|
||||
@@ -155,7 +155,7 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
|
||||
}
|
||||
}
|
||||
}));
|
||||
this._register(this.contextService.onDidChangeWorkbenchState(e => {
|
||||
this.toDispose.push(this.contextService.onDidChangeWorkbenchState(e => {
|
||||
const previousWorkbenchState = this.workbenchState;
|
||||
this.workbenchState = this.contextService.getWorkbenchState();
|
||||
|
||||
@@ -189,8 +189,8 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
|
||||
};
|
||||
update();
|
||||
dom.prepend(container.firstElementChild as HTMLElement, this.watermark);
|
||||
this._register(this.keybindingService.onDidUpdateKeybindings(update));
|
||||
this._register(this.editorGroupsService.onDidLayout(dimension => this.handleEditorPartSize(container, dimension)));
|
||||
this.toDispose.push(this.keybindingService.onDidUpdateKeybindings(update));
|
||||
this.toDispose.push(this.editorGroupsService.onDidLayout(dimension => this.handleEditorPartSize(container, dimension)));
|
||||
this.handleEditorPartSize(container, this.editorGroupsService.dimension);
|
||||
}
|
||||
|
||||
@@ -215,6 +215,10 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
|
||||
this.destroy();
|
||||
this.create();
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
|
||||
|
||||
Reference in New Issue
Block a user