本文整理匯總了TypeScript中vs/base/browser/builder.Builder.size方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Builder.size方法的具體用法?TypeScript Builder.size怎麽用?TypeScript Builder.size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/base/browser/builder.Builder
的用法示例。
在下文中一共展示了Builder.size方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: layout
public layout(dimension: Dimension): Dimension[] {
const { width, height } = dimension;
// Return the applied sizes to title and content
const sizes: Dimension[] = [];
// Title Size: Width (Fill), Height (Variable)
let titleSize: Dimension;
if (this.options && this.options.hasTitle) {
titleSize = new Dimension(width, Math.min(height, TITLE_HEIGHT));
} else {
titleSize = new Dimension(0, 0);
}
// Content Size: Width (Fill), Height (Variable)
const contentSize = new Dimension(width, height - titleSize.height);
if (this.options && typeof this.options.borderWidth === 'function') {
contentSize.width -= this.options.borderWidth(); // adjust for border size
}
sizes.push(titleSize);
sizes.push(contentSize);
// Content
if (this.contentArea) {
this.contentArea.size(contentSize.width, contentSize.height);
}
return sizes;
}
示例2: layout
public layout(dimension: Dimension): void {
// Pass on to Binary Container
this.binaryContainer.size(dimension.width, dimension.height);
this.scrollbar.scanDomNode();
if (this.resourceViewerContext) {
this.resourceViewerContext.layout(dimension);
}
}
示例3: layout
public layout(dimension: Dimension): Dimension[] {
if (!this.containerStyle) {
this.computeStyle();
}
let width = dimension.width - (this.containerStyle.borderLeftWidth + this.containerStyle.borderRightWidth);
let height = dimension.height - (this.containerStyle.borderTopWidth + this.containerStyle.borderBottomWidth);
// Return the applied sizes to title, content and status
let sizes: Dimension[] = [];
// Title Size: Width (Fill), Height (Variable)
let titleSize: Dimension;
if (this.titleArea && this.titleStyle.display !== 'none') {
titleSize = new Dimension(width, Math.min(height, this.titleStyle.height));
} else {
titleSize = new Dimension(0, 0);
}
// Status Size: Width (Fill), Height (Variable)
let statusSize: Dimension;
if (this.statusArea && this.statusStyle.display !== 'none') {
this.statusArea.getHTMLElement().style.height = this.statusArea.getHTMLElement().style.width = '';
statusSize = new Dimension(width, Math.min(height - titleSize.height, this.statusStyle.height));
} else {
statusSize = new Dimension(0, 0);
}
// Content Size: Width (Fill), Height (Variable)
let contentSize = new Dimension(width, height - titleSize.height - statusSize.height);
sizes.push(titleSize);
sizes.push(contentSize);
sizes.push(statusSize);
// Content
if (this.contentArea) {
this.contentArea.size(contentSize.width, contentSize.height);
}
return sizes;
}