panel: limit panel height

This commit is contained in:
isidor
2016-01-15 15:53:54 +01:00
parent bbdd5d5b34
commit 867f165c07

View File

@@ -18,9 +18,10 @@ import {IContextViewService} from 'vs/platform/contextview/browser/contextView';
import {IEventService} from 'vs/platform/event/common/event';
const DEFAULT_MIN_PART_WIDTH = 170;
const DEFAULT_MIN_PANEL_PART_WIDTH = 170;
const DEFAULT_MIN_PANEL_PART_HEIGHT = 170;
const HIDE_SIDEBAR_WIDTH_THRESHOLD = 50;
const HIDE_PANEL_HEIGHT_THRESHOLD = 50;
const PANEL_HEIGHT_SCREEN_LIMIT = 0.8;
const LAYOUT_RELATED_PREFERENCES = [
Preferences.THEME
@@ -249,7 +250,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
},
panelPart: {
minHeight: parseInt(panelPartStyle.getPropertyValue('min-height'), 10) || DEFAULT_MIN_PANEL_PART_WIDTH
minHeight: parseInt(panelPartStyle.getPropertyValue('min-height'), 10) || DEFAULT_MIN_PANEL_PART_HEIGHT
},
editor: {
@@ -308,7 +309,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
if (isPanelPartHidden) {
panelHeight = 0;
} else if (this.panelPartHeight > 0) {
panelHeight = Math.max(this.computedStyles.panelPart.minHeight, this.panelPartHeight);
panelHeight = Math.min(sidebarSize.height * PANEL_HEIGHT_SCREEN_LIMIT, Math.max(this.computedStyles.panelPart.minHeight, this.panelPartHeight));
} else {
panelHeight = sidebarSize.height * 0.4;
}