Skip to content

Commit 5ecafcc

Browse files
committed
deprecate experimental settings
refs microsoft#137633
1 parent 2edb9bc commit 5ecafcc

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

src/vs/workbench/browser/actions/layoutActions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ MenuRegistry.appendMenuItem(MenuId.LayoutControlMenu, {
223223
title: localize('configureLayout', "Configure Layout"),
224224
icon: configureLayoutIcon,
225225
group: '1_workbench_layout',
226-
when: ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'menu')
226+
when: ContextKeyExpr.equals('config.workbench.layoutControl.type', 'menu')
227227
});
228228

229229

@@ -434,7 +434,7 @@ MenuRegistry.appendMenuItems([
434434
icon: panelLeftIcon,
435435
toggled: SideBarVisibleContext
436436
},
437-
when: ContextKeyExpr.and(ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'both')), ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')),
437+
when: ContextKeyExpr.and(ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')), ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')),
438438
order: 0
439439
}
440440
}, {
@@ -447,7 +447,7 @@ MenuRegistry.appendMenuItems([
447447
icon: panelRightIcon,
448448
toggled: SideBarVisibleContext
449449
},
450-
when: ContextKeyExpr.and(ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'both')), ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')),
450+
when: ContextKeyExpr.and(ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')), ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')),
451451
order: 2
452452
}
453453
}
@@ -1200,7 +1200,7 @@ registerAction2(class CustomizeLayoutAction extends Action2 {
12001200
},
12011201
{
12021202
id: MenuId.LayoutControlMenu,
1203-
when: ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'both'),
1203+
when: ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both'),
12041204
group: 'z_end'
12051205
}
12061206
]

src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ MenuRegistry.appendMenuItems([
9090
toggled: AuxiliaryBarVisibleContext,
9191
icon: auxiliaryBarLeftIcon,
9292
},
93-
when: ContextKeyExpr.and(ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'both')), ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')),
93+
when: ContextKeyExpr.and(ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')), ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')),
9494
order: 0
9595
}
9696
},
@@ -104,7 +104,7 @@ MenuRegistry.appendMenuItems([
104104
toggled: AuxiliaryBarVisibleContext,
105105
icon: auxiliaryBarRightIcon,
106106
},
107-
when: ContextKeyExpr.and(ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'both')), ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')),
107+
when: ContextKeyExpr.and(ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')), ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')),
108108
order: 2
109109
}
110110
},

src/vs/workbench/browser/parts/panel/panelActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ MenuRegistry.appendMenuItems([
447447
icon: panelIcon,
448448
toggled: PanelVisibleContext
449449
},
450-
when: ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.experimental.layoutControl.type', 'both')),
450+
when: ContextKeyExpr.or(ContextKeyExpr.equals('config.workbench.layoutControl.type', 'toggles'), ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')),
451451
order: 1
452452
}
453453
}, {

src/vs/workbench/browser/parts/titlebar/titlebarPart.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class TitlebarPart extends Part implements ITitleService {
150150
}
151151
}
152152

153-
if (this.titleBarStyle !== 'native' && this.windowControls && event.affectsConfiguration('workbench.experimental.layoutControl.enabled')) {
153+
if (this.titleBarStyle !== 'native' && this.windowControls && event.affectsConfiguration('workbench.layoutControl.enabled')) {
154154
this.windowControls.classList.toggle('show-layout-control', this.layoutControlEnabled);
155155
}
156156
}
@@ -550,7 +550,7 @@ export class TitlebarPart extends Part implements ITitleService {
550550
}
551551

552552
private get layoutControlEnabled(): boolean {
553-
return this.configurationService.getValue<boolean>('workbench.experimental.layoutControl.enabled');
553+
return this.configurationService.getValue<boolean>('workbench.layoutControl.enabled');
554554
}
555555

556556
updateLayout(dimension: Dimension): void {

src/vs/workbench/browser/workbench.contribution.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,28 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
423423
default: 'auto',
424424
enum: ['on', 'off', 'auto']
425425
},
426+
'workbench.layoutControl.enabled': {
427+
'type': 'boolean',
428+
'default': true,
429+
'markdownDescription': localize({ key: 'layoutControlEnabled', comment: ['{0} is a placeholder for a setting identifier.'] }, "Controls whether the layout controls in the custom title bar is enabled via {0}.", '`#window.titleBarStyle#`'),
430+
},
431+
'workbench.layoutControl.type': {
432+
'type': 'string',
433+
'enum': ['menu', 'toggles', 'both'],
434+
'enumDescriptions': [
435+
localize('layoutcontrol.type.menu', "Shows a single button with a dropdown of layout options."),
436+
localize('layoutcontrol.type.toggles', "Shows several buttons for toggling the visibility of the panels and side bar."),
437+
localize('layoutcontrol.type.both', "Shows both the dropdown and toggle buttons."),
438+
],
439+
'default': 'both',
440+
'description': localize('layoutControlType', "Controls whether the layout control in the custom title bar is displayed as a single menu button or with multiple UI toggles."),
441+
},
426442
'workbench.experimental.layoutControl.enabled': {
427443
'type': 'boolean',
428444
'tags': ['experimental'],
429445
'default': false,
430446
'markdownDescription': localize({ key: 'layoutControlEnabled', comment: ['{0} is a placeholder for a setting identifier.'] }, "Controls whether the layout controls in the custom title bar is enabled via {0}.", '`#window.titleBarStyle#`'),
447+
'markdownDeprecationMessage': localize({ key: 'layoutControlEnabledDeprecation', comment: ['{0} is a placeholder for a setting identifier.'] }, "This setting has been deprecated in favor of {0}", '`#workbench.layoutControl.enabled#`')
431448
},
432449
'workbench.experimental.layoutControl.type': {
433450
'type': 'string',
@@ -440,6 +457,7 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
440457
'tags': ['experimental'],
441458
'default': 'both',
442459
'description': localize('layoutControlType', "Controls whether the layout control in the custom title bar is displayed as a single menu button or with multiple UI toggles."),
460+
'markdownDeprecationMessage': localize({ key: 'layoutControlTypeDeprecation', comment: ['{0} is a placeholder for a setting identifier.'] }, "This setting has been deprecated in favor of {0}", '`#workbench.layoutControl.type#`')
443461
},
444462
'workbench.experimental.editor.dragAndDropIntoEditor.enabled': {
445463
'type': 'boolean',

0 commit comments

Comments
 (0)