Use items width to compute overflow

This commit is contained in:
Sandeep Somavarapu 2018-04-11 17:54:32 +02:00
parent b21e8d48fb
commit 6bf56c43e1
3 changed files with 9 additions and 10 deletions

View file

@ -97,6 +97,14 @@ export class ToolBar {
return this.actionBar.getContainer();
}
public getItemsWidth(): number {
let itemsWidth = 0;
for (let i = 0; i < this.actionBar.length(); i++) {
itemsWidth += this.actionBar.getWidth(i);
}
return itemsWidth;
}
public setAriaLabel(label: string): void {
this.actionBar.setAriaLabel(label);
}

View file

@ -30,10 +30,6 @@
border-left-style: solid;
}
.monaco-workbench > .part.panel > .composite.title > .title-actions {
flex-grow: 0;
}
.monaco-workbench > .part.panel > .title > .title-actions .monaco-action-bar .action-item .action-label {
outline-offset: -2px;
}

View file

@ -43,7 +43,6 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
private blockOpeningPanel: boolean;
private compositeBar: CompositeBar;
private dimension: Dimension;
private toolbarWidth = new Map<string, number>();
constructor(
id: string,
@ -258,11 +257,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
if (!activePanel) {
return 0;
}
if (!this.toolbarWidth.has(activePanel.getId())) {
this.toolbarWidth.set(activePanel.getId(), this.toolBar.getContainer().offsetWidth);
}
return this.toolbarWidth.get(activePanel.getId());
return this.toolBar.getItemsWidth();
}
}