#14464 Preserve editor size when switching layout #17760

Merged
merged 2 commits into from Jan 5, 2017

Projects

None yet

3 participants

@charlespierce
Contributor

Implementation of #14464

Currently when switching from horizontal to vertical editor layout (or vice-versa), the layout is reset to all editors being evenly sized. We would like it if the editors maintained their relative size when switching layouts.

Additionally, the minimized state of any editors should be preserved so that editors that were minimized in one layout are still minimized after switching.

@msftclas

Hi @charlespierce, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@charlespierce charlespierce reopened this Dec 23, 2016
@msftclas

Hi @charlespierce, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.

TTYL, MSBOT;

@msftclas msftclas added the cla-signed label Dec 23, 2016
@bpasero bpasero was assigned by egamma Dec 23, 2016
@bpasero bpasero removed the cla-required label Jan 2, 2017
@bpasero bpasero added this to the January 2017 milestone Jan 4, 2017
@bpasero

@charlespierce very nice. only comment I have is to not expose the "keep ratio" thing to the API because it seems noone outside the editor groups control would ever use it.

@@ -760,7 +760,7 @@ export class EditorGroupsControl implements IEditorGroupsControl, IVerticalSashL
this.sashTwo.setOrientation(this.layoutVertically ? Orientation.VERTICAL : Orientation.HORIZONTAL);
// Trigger layout
- this.arrangeGroups(GroupArrangement.EVEN);
+ this.arrangeGroups(GroupArrangement.KEEP_RATIO);
@bpasero
bpasero Jan 4, 2017 Member

Suggest to not introduce a GroupArrangement.KEEP_RATIO but rather allow to call arrangeGroups without any parameter and then use that as an indication to "keep the ratio". I would not expose this as API but just set the arrangement optional here in this file.

@@ -12,7 +12,8 @@ import Event from 'vs/base/common/event';
export enum GroupArrangement {
MINIMIZE_OTHERS,
- EVEN
+ EVEN,
+ KEEP_RATIO
@bpasero
bpasero Jan 4, 2017 Member

Suggest to not expose.

charlespierce added some commits Dec 23, 2016
@charlespierce charlespierce #14464 Preserve editor size when switching layout c4347fc
@charlespierce charlespierce #14464 Remove KEEP_RATIO from the exposed API
38038ba
@charlespierce
Contributor

@bpasero Removed KEEP_RATIO from the API and rebased to pass CI checks.

@bpasero bpasero merged commit c43059c into Microsoft:master Jan 5, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bpasero
Member
bpasero commented Jan 5, 2017

@charlespierce thanks 👍

@charlespierce charlespierce deleted the charlespierce:preserve_layout branch Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment