當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Builder.size方法代碼示例

本文整理匯總了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;
	}
開發者ID:AlexxNica,項目名稱:sqlopsstudio,代碼行數:31,代碼來源:part.ts

示例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);
		}
	}
開發者ID:costincaraivan,項目名稱:vscode,代碼行數:9,代碼來源:binaryEditor.ts

示例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;
	}
開發者ID:StateFarmIns,項目名稱:vscode,代碼行數:42,代碼來源:part.ts


注:本文中的vs/base/browser/builder.Builder.size方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。