mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-25 14:20:30 -04:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
import 'vs/css!./media/panelpart';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IAction, Action } from 'vs/base/common/actions';
|
||||
import Event from 'vs/base/common/event';
|
||||
import { Builder, Dimension } from 'vs/base/browser/builder';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { $ } from 'vs/base/browser/builder';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IPanel } from 'vs/workbench/common/panel';
|
||||
import { CompositePart, ICompositeTitleLabel } from 'vs/workbench/browser/parts/compositePart';
|
||||
import { Panel, PanelRegistry, Extensions as PanelExtensions } from 'vs/workbench/browser/panel';
|
||||
import { Panel, PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel';
|
||||
import { IPanelService, IPanelIdentifier } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { IPartService, Parts, Position } from 'vs/workbench/services/part/common/partService';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
@@ -30,6 +30,7 @@ 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 { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { Dimension } from 'vs/base/browser/dom';
|
||||
|
||||
export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||
|
||||
@@ -42,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,
|
||||
@@ -100,6 +100,8 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||
|
||||
private registerListeners(): void {
|
||||
|
||||
this.toUnbind.push(this.registry.onDidRegister(panelDescriptor => this.compositeBar.addComposite(panelDescriptor, false)));
|
||||
|
||||
// Activate panel action on opening of a panel
|
||||
this.toUnbind.push(this.onDidPanelOpen(panel => {
|
||||
this.compositeBar.activateComposite(panel.getId());
|
||||
@@ -123,11 +125,11 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||
public updateStyles(): void {
|
||||
super.updateStyles();
|
||||
|
||||
const container = this.getContainer();
|
||||
const container = $(this.getContainer());
|
||||
container.style('background-color', this.getColor(PANEL_BACKGROUND));
|
||||
container.style('border-left-color', this.getColor(PANEL_BORDER) || this.getColor(contrastBorder));
|
||||
|
||||
const title = this.getTitleArea();
|
||||
const title = $(this.getTitleArea());
|
||||
title.style('border-top-color', this.getColor(PANEL_BORDER) || this.getColor(contrastBorder));
|
||||
}
|
||||
|
||||
@@ -169,7 +171,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||
});
|
||||
}
|
||||
|
||||
public getPanels(): IPanelIdentifier[] {
|
||||
public getPanels(): PanelDescriptor[] {
|
||||
return Registry.as<PanelRegistry>(PanelExtensions.Panels).getPanels()
|
||||
.filter(p => p.enabled)
|
||||
.sort((v1, v2) => v1.order - v2.order);
|
||||
@@ -180,7 +182,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||
if (descriptor && descriptor.enabled !== enabled) {
|
||||
descriptor.enabled = enabled;
|
||||
if (enabled) {
|
||||
this.compositeBar.addComposite(descriptor);
|
||||
this.compositeBar.addComposite(descriptor, true);
|
||||
} else {
|
||||
this.compositeBar.removeComposite(id);
|
||||
}
|
||||
@@ -207,8 +209,8 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||
return this.hideActiveComposite().then(composite => void 0);
|
||||
}
|
||||
|
||||
protected createTitleLabel(parent: Builder): ICompositeTitleLabel {
|
||||
const titleArea = this.compositeBar.create(parent.getHTMLElement());
|
||||
protected createTitleLabel(parent: HTMLElement): ICompositeTitleLabel {
|
||||
const titleArea = this.compositeBar.create(parent);
|
||||
titleArea.classList.add('panel-switcher-container');
|
||||
|
||||
return {
|
||||
@@ -241,6 +243,11 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||
return sizes;
|
||||
}
|
||||
|
||||
public shutdown(): void {
|
||||
this.compositeBar.shutdown();
|
||||
super.shutdown();
|
||||
}
|
||||
|
||||
private layoutCompositeBar(): void {
|
||||
if (this.dimension) {
|
||||
let availableWidth = this.dimension.width - 40; // take padding into account
|
||||
@@ -257,11 +264,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().getHTMLElement().offsetWidth);
|
||||
}
|
||||
|
||||
return this.toolbarWidth.get(activePanel.getId());
|
||||
return this.toolBar.getItemsWidth();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user