@@ -47,11 +47,22 @@ import { BaseActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems
4747import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection' ;
4848import { defaultButtonStyles , defaultProgressBarStyles } from 'vs/platform/theme/browser/defaultStyles' ;
4949
50+ export enum ViewPaneShowActions {
51+ /** Show the actions when the view is hovered. This is the default behavior. */
52+ Default ,
53+
54+ /** Always shows the actions when the view is expanded */
55+ WhenExpanded ,
56+
57+ /** Always shows the actions */
58+ Always ,
59+ }
60+
5061export interface IViewPaneOptions extends IPaneOptions {
51- id : string ;
52- showActionsAlways ?: boolean ;
53- titleMenuId ?: MenuId ;
54- donotForwardArgs ?: boolean ;
62+ readonly id : string ;
63+ readonly showActions ?: ViewPaneShowActions ;
64+ readonly titleMenuId ?: MenuId ;
65+ readonly donotForwardArgs ?: boolean ;
5566}
5667
5768export interface IFilterViewPaneOptions extends IViewPaneOptions {
@@ -188,7 +199,7 @@ export abstract class ViewPane extends Pane implements IView {
188199 private progressIndicator ! : IProgressIndicator ;
189200
190201 private toolbar ?: WorkbenchToolBar ;
191- private readonly showActionsAlways : boolean = false ;
202+ private readonly showActions : ViewPaneShowActions ;
192203 private headerContainer ?: HTMLElement ;
193204 private titleContainer ?: HTMLElement ;
194205 private titleDescriptionContainer ?: HTMLElement ;
@@ -219,7 +230,7 @@ export abstract class ViewPane extends Pane implements IView {
219230 this . id = options . id ;
220231 this . _title = options . title ;
221232 this . _titleDescription = options . titleDescription ;
222- this . showActionsAlways = ! ! options . showActionsAlways ;
233+ this . showActions = options . showActions ?? ViewPaneShowActions . Default ;
223234
224235 this . scopedContextKeyService = this . _register ( contextKeyService . createScoped ( this . element ) ) ;
225236 this . scopedContextKeyService . createKey ( 'view' , this . id ) ;
@@ -288,7 +299,8 @@ export abstract class ViewPane extends Pane implements IView {
288299 this . renderHeaderTitle ( container , this . title ) ;
289300
290301 const actions = append ( container , $ ( '.actions' ) ) ;
291- actions . classList . toggle ( 'show' , this . showActionsAlways ) ;
302+ actions . classList . toggle ( 'show-always' , this . showActions === ViewPaneShowActions . Always ) ;
303+ actions . classList . toggle ( 'show-expanded' , this . showActions === ViewPaneShowActions . WhenExpanded ) ;
292304 this . toolbar = this . instantiationService . createInstance ( WorkbenchToolBar , actions , {
293305 orientation : ActionsOrientation . HORIZONTAL ,
294306 actionViewItemProvider : action => this . getActionViewItem ( action ) ,
0 commit comments