mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
This reverts commit d15a3fcc98.
This commit is contained in:
@@ -7,7 +7,7 @@ import { SplitView, Orientation, ISplitViewStyles, IView as ISplitViewView } fro
|
||||
import { $ } from 'vs/base/browser/dom';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { IView } from 'vs/base/browser/ui/grid/gridview';
|
||||
import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
|
||||
export interface CenteredViewState {
|
||||
@@ -48,7 +48,7 @@ export interface ICenteredViewStyles extends ISplitViewStyles {
|
||||
background: Color;
|
||||
}
|
||||
|
||||
export class CenteredViewLayout implements IDisposable {
|
||||
export class CenteredViewLayout {
|
||||
|
||||
private splitView?: SplitView;
|
||||
private width: number = 0;
|
||||
@@ -56,7 +56,7 @@ export class CenteredViewLayout implements IDisposable {
|
||||
private style: ICenteredViewStyles;
|
||||
private didLayout = false;
|
||||
private emptyViews: ISplitViewView[] | undefined;
|
||||
private readonly splitViewDisposables = new DisposableStore();
|
||||
private splitViewDisposables: IDisposable[] = [];
|
||||
|
||||
constructor(private container: HTMLElement, private view: IView, public readonly state: CenteredViewState = { leftMarginRatio: GOLDEN_RATIO.leftMarginRatio, rightMarginRatio: GOLDEN_RATIO.rightMarginRatio }) {
|
||||
this.container.appendChild(this.view.element);
|
||||
@@ -117,13 +117,13 @@ export class CenteredViewLayout implements IDisposable {
|
||||
styles: this.style
|
||||
});
|
||||
|
||||
this.splitViewDisposables.add(this.splitView.onDidSashChange(() => {
|
||||
this.splitViewDisposables.push(this.splitView.onDidSashChange(() => {
|
||||
if (this.splitView) {
|
||||
this.state.leftMarginRatio = this.splitView.getViewSize(0) / this.width;
|
||||
this.state.rightMarginRatio = this.splitView.getViewSize(2) / this.width;
|
||||
}
|
||||
}));
|
||||
this.splitViewDisposables.add(this.splitView.onDidSashReset(() => {
|
||||
this.splitViewDisposables.push(this.splitView.onDidSashReset(() => {
|
||||
this.state.leftMarginRatio = GOLDEN_RATIO.leftMarginRatio;
|
||||
this.state.rightMarginRatio = GOLDEN_RATIO.rightMarginRatio;
|
||||
this.resizeMargins();
|
||||
@@ -138,7 +138,7 @@ export class CenteredViewLayout implements IDisposable {
|
||||
if (this.splitView) {
|
||||
this.container.removeChild(this.splitView.el);
|
||||
}
|
||||
this.splitViewDisposables.clear();
|
||||
this.splitViewDisposables = dispose(this.splitViewDisposables);
|
||||
if (this.splitView) {
|
||||
this.splitView.dispose();
|
||||
}
|
||||
@@ -153,7 +153,7 @@ export class CenteredViewLayout implements IDisposable {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.splitViewDisposables.dispose();
|
||||
this.splitViewDisposables = dispose(this.splitViewDisposables);
|
||||
|
||||
if (this.splitView) {
|
||||
this.splitView.dispose();
|
||||
|
||||
Reference in New Issue
Block a user