Skip to content

#14464 Preserve editor size when switching layout #17760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 5, 2017

Conversation

charlespierce
Copy link
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
Copy link

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;

@msftclas
Copy link

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;

@bpasero bpasero added this to the January 2017 milestone Jan 4, 2017
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to not expose.

@charlespierce
Copy link
Contributor Author

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

@bpasero bpasero merged commit c43059c into microsoft:master Jan 5, 2017
@bpasero
Copy link
Member

bpasero commented Jan 5, 2017

@charlespierce thanks 👍

@charlespierce charlespierce deleted the preserve_layout branch January 5, 2017 16:31
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants