mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from master
This commit is contained in:
@@ -3,12 +3,11 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import 'vs/css!./media/part';
|
||||
import { Component } from 'vs/workbench/common/component';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { Dimension, size } from 'vs/base/browser/dom';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
|
||||
export interface IPartOptions {
|
||||
hasTitle?: boolean;
|
||||
@@ -16,21 +15,22 @@ export interface IPartOptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* Parts are layed out in the workbench and have their own layout that arranges an optional title
|
||||
* and mandatory content area to show content.
|
||||
* Parts are layed out in the workbench and have their own layout that
|
||||
* arranges an optional title and mandatory content area to show content.
|
||||
*/
|
||||
export abstract class Part extends Component {
|
||||
private parent: HTMLElement;
|
||||
private titleArea: HTMLElement;
|
||||
private contentArea: HTMLElement;
|
||||
private titleArea: HTMLElement | null;
|
||||
private contentArea: HTMLElement | null;
|
||||
private partLayout: PartLayout;
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
private options: IPartOptions,
|
||||
themeService: IThemeService
|
||||
themeService: IThemeService,
|
||||
storageService: IStorageService
|
||||
) {
|
||||
super(id, themeService);
|
||||
super(id, themeService, storageService);
|
||||
}
|
||||
|
||||
protected onThemeChange(theme: ITheme): void {
|
||||
@@ -67,28 +67,28 @@ export abstract class Part extends Component {
|
||||
/**
|
||||
* Subclasses override to provide a title area implementation.
|
||||
*/
|
||||
protected createTitleArea(parent: HTMLElement): HTMLElement {
|
||||
protected createTitleArea(parent: HTMLElement): HTMLElement | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the title area container.
|
||||
*/
|
||||
protected getTitleArea(): HTMLElement {
|
||||
protected getTitleArea(): HTMLElement | null {
|
||||
return this.titleArea;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses override to provide a content area implementation.
|
||||
*/
|
||||
protected createContentArea(parent: HTMLElement): HTMLElement {
|
||||
protected createContentArea(parent: HTMLElement): HTMLElement | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content area container.
|
||||
*/
|
||||
protected getContentArea(): HTMLElement {
|
||||
protected getContentArea(): HTMLElement | null {
|
||||
return this.contentArea;
|
||||
}
|
||||
|
||||
@@ -100,11 +100,11 @@ export abstract class Part extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
const TITLE_HEIGHT = 35;
|
||||
|
||||
export class PartLayout {
|
||||
|
||||
constructor(container: HTMLElement, private options: IPartOptions, titleArea: HTMLElement, private contentArea: HTMLElement) { }
|
||||
private static readonly TITLE_HEIGHT = 35;
|
||||
|
||||
constructor(container: HTMLElement, private options: IPartOptions, titleArea: HTMLElement | null, private contentArea: HTMLElement | null) { }
|
||||
|
||||
layout(dimension: Dimension): Dimension[] {
|
||||
const { width, height } = dimension;
|
||||
@@ -115,7 +115,7 @@ export class PartLayout {
|
||||
// Title Size: Width (Fill), Height (Variable)
|
||||
let titleSize: Dimension;
|
||||
if (this.options && this.options.hasTitle) {
|
||||
titleSize = new Dimension(width, Math.min(height, TITLE_HEIGHT));
|
||||
titleSize = new Dimension(width, Math.min(height, PartLayout.TITLE_HEIGHT));
|
||||
} else {
|
||||
titleSize = new Dimension(0, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user