Maximize editor group (#194894)

* Maximize editor

* unmaximze instead of exit maximize

* add tests

* 💄

* adopt changes

* 💄

* 💄

* 💄

* 💄

* 💄

* 💄

* move context key to WorkbenchContextKeysHandler

* 💄

* 💄

* bug fix

* 💄

* touch file to remove from diff

* test maximized group event

* Update editor group behavior

* 💄

* 💄

* 💄

* 💄

* 💄

* 💄

* setvisibility unmaximizes view if maximized

* Add visibility option to serialized branch node
and update gridview reconstruction behavior

* Fix arrangeGroups method signature

* Save maximized view by location

* Fix activeGroup check in EditorPart

* 💄

* 💄

* Add gridWidgetDisposables to prevent memory leaks.

* simplify GridView.setChildVisible

* Refactor Grid class to return IDisposable
from maximizeView method

* 💄

* move maximizing to gridview layer

* Fix trySet2x2 method to
exit maximized view before setting 2x2

* fix bug

* hasMaximizedGroup

* Refactor GridView for hasMaximizedView

* fix migrations

* Fix double click tab toggle
value in workbench editor

* 💄

* Fix editor group expansion test

* 💄

* 💄

* 💄

* Fix migration with new settings validation

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
Co-authored-by: João Moreno <joao.moreno@microsoft.com>
This commit is contained in:
Benjamin Simmonds
2023-10-23 12:37:17 +02:00
committed by GitHub
parent bf9068c750
commit 246abc0ecb
20 changed files with 700 additions and 97 deletions

View File

@@ -322,9 +322,15 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
'description': localize('centeredLayoutDynamicWidth', "Controls whether the centered layout tries to maintain constant width when the window is resized.")
},
'workbench.editor.doubleClickTabToToggleEditorGroupSizes': {
'type': 'boolean',
'default': true,
'markdownDescription': localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'doubleClickTabToToggleEditorGroupSizes' }, "Controls whether to maximize/restore the editor group when double clicking on a tab. This value is ignored when `#workbench.editor.showTabs#` is not set to `multiple`.")
'type': 'string',
'enum': ['maximize', 'expand', 'off'],
'default': 'expand',
'markdownDescription': localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'doubleClickTabToToggleEditorGroupSizes' }, "Controls how the editor group is resized when double clicking on a tab. This value is ignored when `#workbench.editor.showTabs#` is not set to `multiple`."),
'enumDescriptions': [
localize('workbench.editor.doubleClickTabToToggleEditorGroupSizes.maximize', "All other editor groups are hidden and the current editor group is maximized to take up the entire editor area."),
localize('workbench.editor.doubleClickTabToToggleEditorGroupSizes.expand', "The editor group takes as much space as possible by making all other editor groups as small as possible."),
localize('workbench.editor.doubleClickTabToToggleEditorGroupSizes.off', "No editor group is resized when double clicking on a tab.")
]
},
'workbench.editor.limit.enabled': {
'type': 'boolean',
@@ -780,16 +786,20 @@ Registry.as<IConfigurationMigrationRegistry>(Extensions.ConfigurationMigration)
Registry.as<IConfigurationMigrationRegistry>(Extensions.ConfigurationMigration)
.registerConfigurationMigrations([{
key: 'workbench.editor.doubleClickTabToToggleEditorGroupSizes', migrateFn: (value: any) => {
if (typeof value === 'boolean') {
value = value ? 'expand' : 'off';
}
return [['workbench.editor.doubleClickTabToToggleEditorGroupSizes', { value: value }]];
}
}, {
key: 'workbench.editor.showTabs', migrateFn: (value: any) => {
if (typeof value === 'boolean') {
value = value ? 'multiple' : 'single';
}
return [['workbench.editor.showTabs', { value: value }]];
}
}]);
Registry.as<IConfigurationMigrationRegistry>(Extensions.ConfigurationMigration)
.registerConfigurationMigrations([{
}, {
key: 'zenMode.hideTabs', migrateFn: (value: any) => {
const result: ConfigurationKeyValuePairs = [['zenMode.hideTabs', { value: undefined }]];
if (value === true) {