提交 79a042c2 编写于 作者: J Johannes Rieken

simplify height computation

上级 37f5a7fe
......@@ -99,6 +99,8 @@ class Item extends BreadcrumbsItem {
export class BreadcrumbsControl {
static HEIGHT = 25;
static CK_BreadcrumbsVisible = new RawContextKey('breadcrumbsVisible', false);
static CK_BreadcrumbsActive = new RawContextKey('breadcrumbsActive', false);
......@@ -150,15 +152,7 @@ export class BreadcrumbsControl {
this._domNode.remove();
}
getPreferredHeight(): number {
return 25;
}
layout(dim: dom.Dimension): void {
if (dim) {
this._domNode.style.width = `${dim.width}px`;
this._domNode.style.height = `${dim.height}px`;
}
this._widget.layout(dim);
}
......
......@@ -259,6 +259,7 @@
.monaco-workbench > .part.editor > .content .editor-group-container > .title .tabs-breadcrumbs .breadcrumbs-control {
flex: 1 100%;
height: 25px;
}
.monaco-workbench > .part.editor > .content .editor-group-container > .title .tabs-breadcrumbs .breadcrumbs-control .monaco-icon-label::before {
......
......@@ -40,6 +40,7 @@ import { localize } from 'vs/nls';
import { IEditorGroupsAccessor, IEditorPartOptions, IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor';
import { CloseOneEditorAction } from 'vs/workbench/browser/parts/editor/editorActions';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { BreadcrumbsControl } from 'vs/workbench/browser/parts/editor/breadcrumbsControl';
interface IEditorInputLabel {
name: string;
......@@ -928,11 +929,9 @@ export class TabsTitleControl extends TitleControl {
return;
}
let breadcrumbsHeight = 0;
if (this.breadcrumbsControl) {
breadcrumbsHeight = this.breadcrumbsControl.getPreferredHeight();
this.breadcrumbsControl.layout({ width: dimension.width, height: breadcrumbsHeight });
this.scrollbar.getDomNode().style.height = `${dimension.height - breadcrumbsHeight}px`;
this.breadcrumbsControl.layout({ width: dimension.width, height: BreadcrumbsControl.HEIGHT });
this.scrollbar.getDomNode().style.height = `${dimension.height - BreadcrumbsControl.HEIGHT}px`;
}
const visibleContainerWidth = this.tabsContainer.offsetWidth;
......
......@@ -357,7 +357,7 @@ export abstract class TitleControl extends Themable {
}
getPreferredHeight(): number {
return EDITOR_TITLE_HEIGHT + (this.breadcrumbsControl ? this.breadcrumbsControl.getPreferredHeight() : 0);
return EDITOR_TITLE_HEIGHT + (this.breadcrumbsControl ? BreadcrumbsControl.HEIGHT : 0);
}
dispose(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册