提交 8e30f18b 编写于 作者: I isidor

panel: open default panel when no other panel stored

上级 c0152253
......@@ -57,3 +57,5 @@ export class PanelRegistry extends CompositeRegistry<Panel> {
export const Extensions = {
Panels: 'workbench.contributions.panels'
};
Registry.add(Extensions.Panels, new PanelRegistry());
......@@ -150,6 +150,5 @@ export class TogglePanelAction extends Action {
}
}
Registry.add(PanelExtensions.Panels, new PanelRegistry());
let actionRegistry = <IWorkbenchActionRegistry>Registry.as(WorkbenchExtensions.WorkbenchActions);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(TogglePanelAction, TogglePanelAction.ID, TogglePanelAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_L }), nls.localize('view', "View"));
......@@ -203,10 +203,10 @@ export class Workbench implements IPartService {
let compositeAndEditorPromises: Promise[] = [];
// Show default viewlet unless sidebar is hidden or we dont have a default viewlet
let registry = (<ViewletRegistry>Registry.as(ViewletExtensions.Viewlets));
let viewletId = registry.getDefaultViewletId();
let viewletRegistry = (<ViewletRegistry>Registry.as(ViewletExtensions.Viewlets));
let viewletId = viewletRegistry.getDefaultViewletId();
if (!this.workbenchParams.configuration.env.isBuilt) {
viewletId = this.storageService.get(SidebarPart.activeViewletSettingsKey, StorageScope.WORKSPACE, registry.getDefaultViewletId()); // help developers and restore last view
viewletId = this.storageService.get(SidebarPart.activeViewletSettingsKey, StorageScope.WORKSPACE, viewletRegistry.getDefaultViewletId()); // help developers and restore last view
}
if (!this.sideBarHidden && !!viewletId) {
......@@ -214,8 +214,9 @@ export class Workbench implements IPartService {
compositeAndEditorPromises.push(this.sidebarPart.openViewlet(viewletId, false).then(() => viewletTimerEvent.stop()));
}
if (!this.panelHidden) {
const panelId = this.storageService.get(PanelPart.activePanelSettingsKey, StorageScope.WORKSPACE);
let panelRegistry = (<PanelRegistry>Registry.as(PanelExtensions.Panels));
const panelId = this.storageService.get(PanelPart.activePanelSettingsKey, StorageScope.WORKSPACE, panelRegistry.getDefaultPanelId());
if (!this.panelHidden && !!panelId) {
compositeAndEditorPromises.push(this.panelPart.openPanel(panelId, false));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册