diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index bf42f7a41c47d50f0e804d8cce4d75472b8743d5..a9dbf479d3aa37227406fb05f9a2a592a7548b50 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -11,20 +11,13 @@ import {TPromise} from 'vs/base/common/winjs.base'; import {Builder, $} from 'vs/base/browser/builder'; import {Action} from 'vs/base/common/actions'; import errors = require('vs/base/common/errors'); -import {IWorkbenchEditorConfiguration} from 'vs/workbench/common/editor'; import {ActionsOrientation, ActionBar, IActionItem} from 'vs/base/browser/ui/actionbar/actionbar'; import {Registry} from 'vs/platform/platform'; import {IComposite} from 'vs/workbench/common/composite'; -import {IPanel} from 'vs/workbench/common/panel'; -import {ViewletDescriptor, ViewletRegistry, Extensions as ViewletExtensions, Viewlet} from 'vs/workbench/browser/viewlet'; -import {CompositeDescriptor} from 'vs/workbench/browser/composite'; -import {Panel, PanelRegistry, Extensions as PanelExtensions, PanelDescriptor} from 'vs/workbench/browser/panel'; +import {ViewletDescriptor, ViewletRegistry, Extensions as ViewletExtensions} from 'vs/workbench/browser/viewlet'; import {Part} from 'vs/workbench/browser/part'; -import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {ActivityAction, ActivityActionItem} from 'vs/workbench/browser/parts/activitybar/activityAction'; -import {TogglePanelAction} from 'vs/workbench/browser/parts/panel/panelPart'; import {IViewletService} from 'vs/workbench/services/viewlet/common/viewletService'; -import {IPanelService} from 'vs/workbench/services/panel/common/panelService'; import {IActivityService, IBadge} from 'vs/workbench/services/activity/common/activityService'; import {IPartService} from 'vs/workbench/services/part/common/partService'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; @@ -33,20 +26,15 @@ import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding'; export class ActivitybarPart extends Part implements IActivityService { public _serviceBrand: any; private viewletSwitcherBar: ActionBar; - private panelSwitcherBar: ActionBar; private activityActionItems: { [actionId: string]: IActionItem; }; private compositeIdToActions: { [compositeId: string]: ActivityAction; }; - private panelActions: ActivityAction[]; - private togglePanelAction: TogglePanelAction; constructor( id: string, @IViewletService private viewletService: IViewletService, - @IPanelService private panelService: IPanelService, @IKeybindingService private keybindingService: IKeybindingService, @IInstantiationService private instantiationService: IInstantiationService, - @IPartService private partService: IPartService, - @IConfigurationService protected configurationService: IConfigurationService + @IPartService private partService: IPartService ) { super(id); @@ -60,20 +48,9 @@ export class ActivitybarPart extends Part implements IActivityService { // Activate viewlet action on opening of a viewlet this.toUnbind.push(this.viewletService.onDidViewletOpen(viewlet => this.onActiveCompositeChanged(viewlet))); - this.toUnbind.push(this.panelService.onDidPanelOpen(panel => this.onActivePanelChanged(panel))); // Deactivate viewlet action on close this.toUnbind.push(this.viewletService.onDidViewletClose(viewlet => this.onCompositeClosed(viewlet))); - this.toUnbind.push(this.panelService.onDidPanelClose(panel => this.onPanelClosed(panel))); - - this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); - - } - - private onConfigurationUpdated(config: IWorkbenchEditorConfiguration): void { - if (this.panelSwitcherBar) { - config.workbench.panels.showInSidebar ? this.panelSwitcherBar.getContainer().show() : this.panelSwitcherBar.getContainer().hide(); - } } private onActiveCompositeChanged(composite: IComposite): void { @@ -82,31 +59,15 @@ export class ActivitybarPart extends Part implements IActivityService { } } - private onActivePanelChanged(panel: IPanel): void { - this.updatePanelSwitcher(); - this.onActiveCompositeChanged(panel); - } - private onCompositeClosed(composite: IComposite): void { if (this.compositeIdToActions[composite.getId()]) { this.compositeIdToActions[composite.getId()].deactivate(); } } - private onPanelClosed(panel: IPanel): void { - this.updatePanelSwitcher(); - this.onCompositeClosed(panel); - } - public showActivity(compositeId: string, badge: IBadge, clazz?: string): void { const action = this.compositeIdToActions[compositeId]; if (action) { - if (action instanceof PanelActivityAction && this.partService.isPanelHidden()) { - // while the panel badges are hidden we show the badge on the parent action which is visible - this.togglePanelAction.setBadge(badge); - return; - } - action.setBadge(badge); if (clazz) { action.class = clazz; @@ -124,7 +85,6 @@ export class ActivitybarPart extends Part implements IActivityService { // Top Actionbar with action items for each viewlet action this.createViewletSwitcher($result.clone()); - this.createPanelSwitcher($result.clone()); return $result; } @@ -146,69 +106,15 @@ export class ActivitybarPart extends Part implements IActivityService { this.viewletSwitcherBar.push(viewletActions, { label: true, icon: true }); } - private createPanelSwitcher(div: Builder): void { - - // Composite switcher is on top - this.panelSwitcherBar = new ActionBar(div, { - actionItemProvider: (action: Action) => this.activityActionItems[action.id], - orientation: ActionsOrientation.VERTICAL, - ariaLabel: nls.localize('activityBarPanelAriaLabel', "Active Panel Switcher") - }); - this.panelSwitcherBar.getContainer().addClass('position-bottom'); - if (!this.configurationService.lookup('workbench.panels.showInSidebar').value) { - this.panelSwitcherBar.getContainer().hide(); - } - - // Build Viewlet Actions in correct order - - const allPanels = (Registry.as(PanelExtensions.Panels)).getPanels(); - - this.togglePanelAction = this.instantiationService.createInstance(TogglePanelAction, TogglePanelAction.ID, TogglePanelAction.LABEL); - this.activityActionItems[this.togglePanelAction.id] = new ActivityActionItem(this.togglePanelAction, TogglePanelAction.LABEL, this.getKeybindingLabel(TogglePanelAction.ID)); - this.panelActions = allPanels.sort((p1, p2) => p1.order - p2.order).map(panel => this.toAction(panel)); - - // Add both viewlet and panel actions to the switcher - this.updatePanelSwitcher(); - } - - private updatePanelSwitcher(): void { - this.panelSwitcherBar.clear(); - this.togglePanelAction.class = this.partService.isPanelHidden() ? 'panel' : 'panel expanded'; - const actions: ActivityAction[] = []; - if (!this.partService.isPanelHidden()) { - actions.push(...this.panelActions); - } - actions.push(this.togglePanelAction); - - this.panelSwitcherBar.push(actions, { label: true, icon: true }); - - // TODO@Isidor fix this aweful badge(r) hacks - if (!this.partService.isPanelHidden()) { - if (!this.panelActions[0].getBadge()) { - this.panelActions[0].setBadge(this.togglePanelAction.getBadge()); - } else { - this.panelActions[0].setBadge(this.panelActions[0].getBadge()); - } - this.togglePanelAction.setBadge(null); - } else { - this.togglePanelAction.setBadge(this.panelActions[0].getBadge()); - if (this.panelActions[0].getBadge()) { - this.panelActions[0].setBadge(null); - } - } - } - - private toAction(composite: CompositeDescriptor): ActivityAction { + private toAction(composite: ViewletDescriptor): ActivityAction { const activeViewlet = this.viewletService.getActiveViewlet(); - const activePanel = this.panelService.getActivePanel(); - const action = composite instanceof ViewletDescriptor ? this.instantiationService.createInstance(ViewletActivityAction, composite.id + '.activity-bar-action', composite) - : this.instantiationService.createInstance(PanelActivityAction, (composite).id + '.activity-bar-action', composite); + const action = this.instantiationService.createInstance(ViewletActivityAction, composite.id + '.activity-bar-action', composite); this.activityActionItems[action.id] = new ActivityActionItem(action, composite.name, this.getKeybindingLabel(composite.id)); this.compositeIdToActions[composite.id] = action; - // Mark active viewlet and panel action as active - if (activeViewlet && activeViewlet.getId() === composite.id || activePanel && activePanel.getId() === composite.id) { + // Mark active viewlet as active + if (activeViewlet && activeViewlet.getId() === composite.id) { action.activate(); } @@ -230,15 +136,6 @@ export class ActivitybarPart extends Part implements IActivityService { this.viewletSwitcherBar = null; } - if (this.panelSwitcherBar) { - this.panelSwitcherBar.dispose(); - this.panelSwitcherBar = null; - } - - if (this.togglePanelAction) { - this.togglePanelAction.dispose(); - } - super.dispose(); } } @@ -278,17 +175,3 @@ class ViewletActivityAction extends ActivityAction { return TPromise.as(true); } } - -class PanelActivityAction extends ActivityAction { - - constructor( - id: string, private panel: PanelDescriptor, - @IPanelService private panelService: IPanelService - ) { - super(id, panel.name, panel.cssClass); - } - - public run(): TPromise { - return this.panelService.openPanel(this.panel.id, true).then(() => this.activate()); - } -} diff --git a/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css b/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css index f1481906e3427cd4b68f28fc4613674dfa49b3fd..2b06c3d4a9cf6635d5eb4c66a415a223fa4d3803 100644 --- a/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css +++ b/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css @@ -3,12 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-workbench > .activitybar .monaco-action-bar .action-label.panel { - background: url('panel.svg') center center no-repeat; - background-position: 50% !important; - background-size: 32px; -} - .monaco-workbench > .activitybar .monaco-action-bar .action-label.panel.expanded { transform: rotate(180deg); } diff --git a/src/vs/workbench/browser/parts/activitybar/media/panel.svg b/src/vs/workbench/browser/parts/activitybar/media/panel.svg deleted file mode 100755 index 88c05455cb33568b46ca417bbb87f79262f40ecb..0000000000000000000000000000000000000000 --- a/src/vs/workbench/browser/parts/activitybar/media/panel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 47ea31aa5bb00e8279ce9baac079c961c1d2ba25..b25dccd6e9d97cdb2cd70df60c88b13bda89abf0 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -884,9 +884,6 @@ export interface IWorkbenchEditorConfiguration { enablePreview: boolean; enablePreviewFromQuickOpen: boolean; openPositioning: string; - }, - panels: { - showInSidebar: boolean } }; } diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index 285188bce6f85c29ede0bc4a2090a844ecce02c3..57379719433f403f1a86fe9c21a5c7749a25b2ee 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -109,11 +109,6 @@ configurationRegistry.registerConfiguration({ 'type': 'boolean', 'description': nls.localize('openDefaultSettings', "Controls if opening settings also opens an editor showing all default settings."), 'default': true - }, - 'workbench.panels.showInSidebar': { - 'type': 'boolean', - 'description': nls.localize('panelsShowInSidebar', "Controls if panel icons are shown in the sidebar below the viewlet icons."), - 'default': false } } }); diff --git a/src/vs/workbench/parts/debug/browser/media/repl-panel.svg b/src/vs/workbench/parts/debug/browser/media/repl-panel.svg deleted file mode 100755 index 2bbbdd6cde0effc6787513c6da29ba225642f7f4..0000000000000000000000000000000000000000 --- a/src/vs/workbench/parts/debug/browser/media/repl-panel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/debug/browser/media/repl.css b/src/vs/workbench/parts/debug/browser/media/repl.css index 2f3a298a19511c9a025c6712a42c09872873b1f8..da25304d6afda3740145c90f4a5ecd4151ba9756 100644 --- a/src/vs/workbench/parts/debug/browser/media/repl.css +++ b/src/vs/workbench/parts/debug/browser/media/repl.css @@ -5,13 +5,6 @@ /* Debug repl */ -/* Activity Bar */ -.monaco-workbench > .activitybar .monaco-action-bar .action-label.repl { - background: url('repl-panel.svg') center center no-repeat; - background-position: 50% !important; - background-size: 32px; -} - .monaco-workbench .repl { height: 100%; position: relative; diff --git a/src/vs/workbench/parts/markers/browser/media/markers.css b/src/vs/workbench/parts/markers/browser/media/markers.css index 3e46357bb35859dd9b3b8ba0898375a6da6fdeac..491e4ac3590ad6d1e5a0cb23af7fadcab37e2f32 100644 --- a/src/vs/workbench/parts/markers/browser/media/markers.css +++ b/src/vs/workbench/parts/markers/browser/media/markers.css @@ -3,13 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/* Activity Bar */ -.monaco-workbench > .activitybar .monaco-action-bar .action-label.markersPanel { - background: url('markers.svg') center center no-repeat; - background-position: 50% !important; - background-size: 32px; -} - .monaco-action-bar .action-item.markers-panel-action-filter { max-width: 400px; min-width: 100px; diff --git a/src/vs/workbench/parts/markers/browser/media/markers.svg b/src/vs/workbench/parts/markers/browser/media/markers.svg deleted file mode 100755 index 891a04fb389b0548fb5b5f2469fd9a0be37337a1..0000000000000000000000000000000000000000 --- a/src/vs/workbench/parts/markers/browser/media/markers.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/output/browser/media/output.contribution.css b/src/vs/workbench/parts/output/browser/media/output.contribution.css index a1c1e78a40d7a52a548c75aa725bd7a1da1d7b34..093845880a305ad6818f3240c548903c8dd5c1cf 100644 --- a/src/vs/workbench/parts/output/browser/media/output.contribution.css +++ b/src/vs/workbench/parts/output/browser/media/output.contribution.css @@ -3,14 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/* Activity Bar */ -.monaco-workbench > .activitybar .monaco-action-bar .action-label.output { - background: url('output.svg') center center no-repeat; - background-position: 50% !important; - background-size: 32px; -} - - .monaco-workbench .output-action.clear-output { background: url('clear_output.svg') center center no-repeat; } diff --git a/src/vs/workbench/parts/output/browser/media/output.svg b/src/vs/workbench/parts/output/browser/media/output.svg deleted file mode 100755 index 64df3e6589661ea3b83b944d407e30fb5fc5cd05..0000000000000000000000000000000000000000 --- a/src/vs/workbench/parts/output/browser/media/output.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css b/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css deleted file mode 100644 index e5df15640be6a993b63684875287d2844d95dfb8..0000000000000000000000000000000000000000 --- a/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css +++ /dev/null @@ -1,53 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/* Activity Bar */ -.monaco-workbench > .activitybar .monaco-action-bar .action-label.terminal { - background: url('terminal.svg') center center no-repeat; - background-position: 50% !important; - background-size: 32px; -} - -.monaco-workbench .panel.integrated-terminal { - align-content: flex-start; - align-items: baseline; - display: flex; - flex-direction: column; - background-color: transparent!important; - color: #333; - -webkit-user-select: initial; - overflow: hidden; /* prevents the terminal output being incorrectly placed over the title */ -} -.vs-dark .monaco-workbench .panel.integrated-terminal { color: #CCC; } -.hc-black .monaco-workbench .panel.integrated-terminal { color: #FFF; } - -.monaco-workbench .panel.integrated-terminal .terminal-outer-container { - height: 100%; - padding: 0 20px; - width: 100%; -} - -.monaco-workbench .panel.integrated-terminal .terminal-wrapper { - display: none; -} -.monaco-workbench .panel.integrated-terminal .terminal-wrapper.active { - display: block; - position: absolute; - bottom: 0; -} - -/* Terminal actions */ - -/* Light theme */ -.monaco-workbench .terminal-action.kill { background: url('kill.svg') center center no-repeat; } -.monaco-workbench .terminal-action.new { background: url('new.svg') center center no-repeat; } -/* Dark theme / HC theme */ -.vs-dark .monaco-workbench .terminal-action.kill, .hc-black .monaco-workbench .terminal-action.kill { background: url('kill-inverse.svg') center center no-repeat; } -.vs-dark .monaco-workbench .terminal-action.new, .hc-black .monaco-workbench .terminal-action.new { background: url('new-inverse.svg') center center no-repeat; } - -.vs-dark .monaco-workbench.mac .panel.integrated-terminal .xterm-rows, -.hc-black .monaco-workbench.mac .panel.integrated-terminal .xterm-rows { - cursor: -webkit-image-set(url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII=') 1x, url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC') 2x) 5 8, text; -} \ No newline at end of file