Global settings: bad overflow behaviour (fixes #27820)

This commit is contained in:
Benjamin Pasero
2017-08-11 17:30:04 +02:00
parent 02bbc149cf
commit da809dfcf4
2 changed files with 7 additions and 27 deletions
@@ -523,30 +523,6 @@ export class ViewletOverflowActivityActionItem extends ActivityActionItem {
this.name = action.label;
}
protected updateStyles(): void {
const theme = this.themeService.getTheme();
// Label
if (this.$label) {
const background = theme.getColor(ACTIVITY_BAR_FOREGROUND);
this.$label.style('background-color', background ? background.toString() : null);
}
}
public render(container: HTMLElement): void {
super.render(container);
this.$label = $('a.action-label').attr({
tabIndex: '0',
role: 'button',
title: this.name,
class: this.cssClass
}).appendTo(this.builder);
this.updateStyles();
}
public showMenu(): void {
if (this.actions) {
dispose(this.actions);
@@ -293,8 +293,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
private updateViewletSwitcher() {
if (!this.viewletSwitcherBar) {
// We have not been rendered yet so there is nothing to update.
return;
return; // We have not been rendered yet so there is nothing to update.
}
let viewletsToShow = this.getPinnedViewlets();
@@ -311,7 +310,12 @@ export class ActivitybarPart extends Part implements IActivityBarService {
// Ensure we are not showing more viewlets than we have height for
let overflows = false;
if (this.dimension) {
const maxVisible = Math.floor(this.dimension.height / ActivitybarPart.ACTIVITY_ACTION_HEIGHT);
let availableHeight = this.dimension.height;
if (this.globalActionBar) {
availableHeight -= (this.globalActionBar.items.length * ActivitybarPart.ACTIVITY_ACTION_HEIGHT); // adjust for global actions showing
}
const maxVisible = Math.floor(availableHeight / ActivitybarPart.ACTIVITY_ACTION_HEIGHT);
overflows = viewletsToShow.length > maxVisible;
if (overflows) {