提交 0287d832 编写于 作者: I isidor

get toolbar width only once

fixes #39185
上级 8f69bfe9
......@@ -31,6 +31,7 @@ import { ToggleCompositePinnedAction } from 'vs/workbench/browser/parts/composit
import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { IBadge } from 'vs/workbench/services/activity/common/activity';
import { memoize } from 'vs/base/common/decorators';
export class PanelPart extends CompositePart<Panel> implements IPanelService {
......@@ -234,12 +235,17 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
let availableWidth = this.dimension.width - 8; // take padding into account
if (this.toolBar) {
// adjust height for global actions showing
availableWidth = Math.max(PanelPart.MIN_COMPOSITE_BAR_WIDTH, availableWidth - this.toolBar.getContainer().getHTMLElement().offsetWidth);
availableWidth = Math.max(PanelPart.MIN_COMPOSITE_BAR_WIDTH, availableWidth - this.toolbarWidth);
}
this.compositeBar.layout(new Dimension(availableWidth, this.dimension.height));
}
}
@memoize
private get toolbarWidth(): number {
return this.toolBar.getContainer().getHTMLElement().offsetWidth;
}
public shutdown(): void {
// Persist Hidden State
this.compositeBar.store();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册