提交 68f7dde8 编写于 作者: J Joao Moreno

Merge branch 'JacksonKearl-bug/workbench-layout/option-for-always-visible-actions'

......@@ -54,6 +54,7 @@
/* TODO: actions should be part of the panel, but they aren't yet */
.monaco-panel-view .panel:hover > .panel-header.expanded > .actions,
.monaco-panel-view .panel > .panel-header.actions-always-visible.expanded > .actions,
.monaco-panel-view .panel > .panel-header.focused.expanded > .actions {
display: initial;
}
......
......@@ -190,9 +190,10 @@ export class CustomTreeViewPanel extends ViewsViewletPanel {
@IContextMenuService contextMenuService: IContextMenuService,
@IInstantiationService private instantiationService: IInstantiationService,
@IThemeService private themeService: IWorkbenchThemeService,
@ICommandService private commandService: ICommandService
@ICommandService private commandService: ICommandService,
@IConfigurationService configurationService: IConfigurationService
) {
super({ ...(options as IViewOptions), ariaHeaderLabel: options.name }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: options.name }, keybindingService, contextMenuService, configurationService);
this.menus = this.instantiationService.createInstance(Menus, this.id);
this.menus.onDidChangeTitle(() => this.updateActions(), this, this.disposables);
this.treeViewer = this.instantiationService.createInstance(TreeViewer, this.id);
......
......@@ -6,12 +6,12 @@
import 'vs/css!./media/panelviewlet';
import * as nls from 'vs/nls';
import { TPromise } from 'vs/base/common/winjs.base';
import Event, { Emitter } from 'vs/base/common/event';
import Event, { Emitter, filterEvent } from 'vs/base/common/event';
import { ColorIdentifier, contrastBorder } from 'vs/platform/theme/common/colorRegistry';
import { attachStyler, IColorMapping, IThemable } from 'vs/platform/theme/common/styler';
import { SIDE_BAR_DRAG_AND_DROP_BACKGROUND, SIDE_BAR_SECTION_HEADER_FOREGROUND, SIDE_BAR_SECTION_HEADER_BACKGROUND } from 'vs/workbench/common/theme';
import { Dimension, Builder } from 'vs/base/browser/builder';
import { append, $, trackFocus } from 'vs/base/browser/dom';
import { append, $, trackFocus, toggleClass } from 'vs/base/browser/dom';
import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
import { firstIndex } from 'vs/base/common/arrays';
import { IAction, IActionRunner } from 'vs/base/common/actions';
......@@ -25,6 +25,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { PanelView, IPanelViewOptions, IPanelOptions, Panel } from 'vs/base/browser/ui/splitview/panelview';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export interface IPanelColors extends IColorMapping {
dropBackground?: ColorIdentifier;
......@@ -48,17 +49,21 @@ export interface IViewletPanelOptions extends IPanelOptions {
export abstract class ViewletPanel extends Panel {
private static AlwaysShowActionsConfig = 'workbench.panel.alwaysShowActions';
private _onDidFocus = new Emitter<void>();
readonly onDidFocus: Event<void> = this._onDidFocus.event;
protected actionRunner: IActionRunner;
protected toolbar: ToolBar;
private headerContainer: HTMLElement;
constructor(
readonly title: string,
options: IViewletPanelOptions,
@IKeybindingService protected keybindingService: IKeybindingService,
@IContextMenuService protected contextMenuService: IContextMenuService
@IContextMenuService protected contextMenuService: IContextMenuService,
@IConfigurationService protected readonly configurationService: IConfigurationService
) {
super(options);
......@@ -74,6 +79,8 @@ export abstract class ViewletPanel extends Panel {
}
protected renderHeader(container: HTMLElement): void {
this.headerContainer = container;
this.renderHeaderTitle(container);
const actions = append(container, $('.actions'));
......@@ -87,6 +94,10 @@ export abstract class ViewletPanel extends Panel {
this.disposables.push(this.toolbar);
this.updateActions();
const onDidRelevantConfigurationChange = filterEvent(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration(ViewletPanel.AlwaysShowActionsConfig));
onDidRelevantConfigurationChange(this.updateActionsVisibility, this, this.disposables);
this.updateActionsVisibility();
}
protected renderHeaderTitle(container: HTMLElement): void {
......@@ -102,6 +113,11 @@ export abstract class ViewletPanel extends Panel {
this.toolbar.context = this.getActionsContext();
}
protected updateActionsVisibility(): void {
const shouldAlwaysShowActions = this.configurationService.getValue<boolean>('workbench.panel.alwaysShowActions');
toggleClass(this.headerContainer, 'actions-always-visible', shouldAlwaysShowActions);
}
getActions(): IAction[] {
return [];
}
......
......@@ -48,9 +48,10 @@ export abstract class ViewsViewletPanel extends ViewletPanel {
constructor(
options: IViewOptions,
protected keybindingService: IKeybindingService,
protected contextMenuService: IContextMenuService
protected contextMenuService: IContextMenuService,
@IConfigurationService configurationService: IConfigurationService
) {
super(options.name, options, keybindingService, contextMenuService);
super(options.name, options, keybindingService, contextMenuService, configurationService);
this.id = options.id;
this.name = options.name;
......
......@@ -251,6 +251,11 @@ configurationRegistry.registerConfiguration({
'default': true,
'description': nls.localize('activityBarVisibility', "Controls the visibility of the activity bar in the workbench.")
},
'workbench.panel.alwaysShowActions': {
'type': 'boolean',
'default': false,
'description': nls.localize('panelActionVisibility', "Controls the visibility of side panel tree view actions. Panel actions may either be always visible, or only visible when that panel is focused or hovered over.")
},
'workbench.fontAliasing': {
'type': 'string',
'enum': ['default', 'antialiased', 'none', 'auto'],
......
......@@ -32,6 +32,7 @@ import { WorkbenchList } from 'vs/platform/list/browser/listService';
import { ViewsViewletPanel, IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet';
import { attachInputBoxStyler } from 'vs/platform/theme/common/styler';
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
const $ = dom.$;
......@@ -51,9 +52,10 @@ export class BreakpointsView extends ViewsViewletPanel {
@IInstantiationService private instantiationService: IInstantiationService,
@IThemeService private themeService: IThemeService,
@IEditorService private editorService: IEditorService,
@IContextViewService private contextViewService: IContextViewService
@IContextViewService private contextViewService: IContextViewService,
@IConfigurationService configurationService: IConfigurationService
) {
super(options, keybindingService, contextMenuService);
super(options, keybindingService, contextMenuService, configurationService);
this.minimumBodySize = this.maximumBodySize = this.getExpandedBodySize();
this.settings = options.viewletSettings;
......
......@@ -26,6 +26,7 @@ import { Source } from 'vs/workbench/parts/debug/common/debugSource';
import { basenameOrAuthority } from 'vs/base/common/resources';
import { TreeResourceNavigator, WorkbenchTree } from 'vs/platform/list/browser/listService';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
const $ = dom.$;
......@@ -47,8 +48,9 @@ export class CallStackView extends TreeViewsViewletPanel {
@IKeybindingService keybindingService: IKeybindingService,
@IInstantiationService private instantiationService: IInstantiationService,
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IConfigurationService configurationService: IConfigurationService,
) {
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('callstackSection', "Call Stack Section") }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('callstackSection', "Call Stack Section") }, keybindingService, contextMenuService, configurationService);
this.settings = options.viewletSettings;
// Create scheduler to prevent unnecessary flashing of tree when reacting to changes
......
......@@ -28,6 +28,7 @@ import { equalsIgnoreCase } from 'vs/base/common/strings';
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import { WorkbenchTree } from 'vs/platform/list/browser/listService';
import { OpenMode } from 'vs/base/parts/tree/browser/treeDefaults';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
const $ = dom.$;
......@@ -45,9 +46,10 @@ export class VariablesView extends TreeViewsViewletPanel {
@IContextMenuService contextMenuService: IContextMenuService,
@IDebugService private debugService: IDebugService,
@IKeybindingService keybindingService: IKeybindingService,
@IInstantiationService private instantiationService: IInstantiationService
@IInstantiationService private instantiationService: IInstantiationService,
@IConfigurationService configurationService: IConfigurationService
) {
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService, configurationService);
this.settings = options.viewletSettings;
this.expandedElements = [];
......
......@@ -28,6 +28,7 @@ import { IMouseEvent, DragMouseEvent } from 'vs/base/browser/mouseEvent';
import { DefaultDragAndDrop, OpenMode, ClickBehavior } from 'vs/base/parts/tree/browser/treeDefaults';
import { IVariableTemplateData, renderVariable, renderRenameBox, renderExpressionValue, BaseDebugController, twistiePixels, renderViewTree } from 'vs/workbench/parts/debug/electron-browser/baseDebugView';
import { WorkbenchTree } from 'vs/platform/list/browser/listService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
const $ = dom.$;
const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024;
......@@ -45,9 +46,10 @@ export class WatchExpressionsView extends TreeViewsViewletPanel {
@IContextMenuService contextMenuService: IContextMenuService,
@IDebugService private debugService: IDebugService,
@IKeybindingService keybindingService: IKeybindingService,
@IInstantiationService private instantiationService: IInstantiationService
@IInstantiationService private instantiationService: IInstantiationService,
@IConfigurationService configurationService: IConfigurationService
) {
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('expressionsSection', "Expressions Section") }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('expressionsSection', "Expressions Section") }, keybindingService, contextMenuService, configurationService);
this.settings = options.viewletSettings;
this.onWatchExpressionsUpdatedScheduler = new RunOnceScheduler(() => {
......
......@@ -36,6 +36,7 @@ import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { InstallWorkspaceRecommendedExtensionsAction, ConfigureWorkspaceFolderRecommendedExtensionsAction } from 'vs/workbench/parts/extensions/browser/extensionsActions';
import { WorkbenchPagedList } from 'vs/platform/list/browser/listService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export class ExtensionsListView extends ViewsViewletPanel {
......@@ -58,9 +59,10 @@ export class ExtensionsListView extends ViewsViewletPanel {
@IEditorGroupService private editorInputService: IEditorGroupService,
@IExtensionTipsService private tipsService: IExtensionTipsService,
@IModeService private modeService: IModeService,
@ITelemetryService private telemetryService: ITelemetryService
@ITelemetryService private telemetryService: ITelemetryService,
@IConfigurationService configurationService: IConfigurationService
) {
super({ ...(options as IViewOptions), ariaHeaderLabel: options.name }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: options.name }, keybindingService, contextMenuService, configurationService);
}
renderHeader(container: HTMLElement): void {
......
......@@ -21,6 +21,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export class EmptyView extends ViewsViewletPanel {
......@@ -37,9 +38,10 @@ export class EmptyView extends ViewsViewletPanel {
@IInstantiationService private instantiationService: IInstantiationService,
@IKeybindingService keybindingService: IKeybindingService,
@IContextMenuService contextMenuService: IContextMenuService,
@IWorkspaceContextService private contextService: IWorkspaceContextService
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IConfigurationService configurationService: IConfigurationService
) {
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") }, keybindingService, contextMenuService, configurationService);
this.contextService.onDidChangeWorkbenchState(() => this.setLabels());
}
......
......@@ -92,10 +92,10 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView
@IPartService private partService: IPartService,
@IKeybindingService keybindingService: IKeybindingService,
@IContextKeyService contextKeyService: IContextKeyService,
@IConfigurationService private configurationService: IConfigurationService,
@IConfigurationService configurationService: IConfigurationService,
@IDecorationsService decorationService: IDecorationsService
) {
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") }, keybindingService, contextMenuService, configurationService);
this.settings = options.viewletSettings;
this.viewletState = options.viewletState;
......
......@@ -68,7 +68,7 @@ export class OpenEditorsView extends ViewsViewletPanel {
@ITextFileService private textFileService: ITextFileService,
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IEditorGroupService private editorGroupService: IEditorGroupService,
@IConfigurationService private configurationService: IConfigurationService,
@IConfigurationService configurationService: IConfigurationService,
@IKeybindingService keybindingService: IKeybindingService,
@IUntitledEditorService private untitledEditorService: IUntitledEditorService,
@IContextKeyService private contextKeyService: IContextKeyService,
......@@ -79,7 +79,7 @@ export class OpenEditorsView extends ViewsViewletPanel {
super({
...(options as IViewOptions),
ariaHeaderLabel: nls.localize({ key: 'openEditosrSection', comment: ['Open is an adjective'] }, "Open Editors Section"),
}, keybindingService, contextMenuService);
}, keybindingService, contextMenuService, configurationService);
this.model = editorGroupService.getStacksModel();
......
......@@ -212,9 +212,10 @@ class MainPanel extends ViewletPanel {
@ISCMService protected scmService: ISCMService,
@IInstantiationService private instantiationService: IInstantiationService,
@IContextKeyService private contextKeyService: IContextKeyService,
@IMenuService private menuService: IMenuService
@IMenuService private menuService: IMenuService,
@IConfigurationService configurationService: IConfigurationService
) {
super(localize('scm providers', "Source Control Providers"), {}, keybindingService, contextMenuService);
super(localize('scm providers', "Source Control Providers"), {}, keybindingService, contextMenuService, configurationService);
this.updateBodySize();
}
......@@ -753,7 +754,7 @@ export class RepositoryPanel extends ViewletPanel {
@IContextKeyService protected contextKeyService: IContextKeyService,
@IMenuService protected menuService: IMenuService
) {
super(repository.provider.label, {}, keybindingService, contextMenuService);
super(repository.provider.label, {}, keybindingService, contextMenuService, configurationService);
this.menus = instantiationService.createInstance(SCMMenus, repository.provider);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册