Skip to content
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

Allow joining of separators. #72

Open
markalfred opened this issue Oct 22, 2014 · 6 comments
Open

Allow joining of separators. #72

markalfred opened this issue Oct 22, 2014 · 6 comments
Assignees

Comments

@markalfred
Copy link

I have a 2x2 grid...

...... ......
...... ......

and I add a new column on the right of my top row and on the right of my bottom row...

...... ... ...
...... ... ...

I can resize the first column on both rows simultaneously...

.. ....... ...
.. ....... ...

but the last columns are controlled separately...

.. .. ........
.. ....... ...

In some cases, this is what I want. But at times, I'd like to be able to create a column that spans both rows and is resized simultaneously. In the first case, my layout looks like...

{
  'cells': [[0, 0, 1, 1], [1, 0, 2, 1], [0, 1, 1, 2], [1, 1, 3, 2], [2, 0, 4, 1], [3, 1, 4, 2]],
  'rows': [0.0, 0.5, 1.0],
  'cols': [0.0, 0.5, 0.75, 0.75, 1.0]
}

If I choose to do so, Origami could take this layout and combine any duplicate row/col measures into one. In this case...

{
  'cells': [[0, 0, 1, 1], [1, 0, 2, 1], [0, 1, 1, 2], [1, 1, 3, 2], [2, 0, 4, 1], [3, 1, 4, 2]],
                                                             ^       ^     ^       ^     ^
  'rows': [0.0, 0.5, 1.0],
  'cols': [0.0, 0.5, 0.75, 0.75, 1.0]
                     ^^^^  ^^^^
}

The 0.75s in 'cols' are combined, and all references to them are adjusted accordingly (in 'cells', the "3"s will become "2"s, and the "4"s become "3"s). We get...

{
  'cells': [[0, 0, 1, 1], [1, 0, 2, 1], [0, 1, 1, 2], [1, 1, 2, 2], [2, 0, 3, 1], [2, 1, 3, 2]],
  'rows': [0.0, 0.5, 1.0],
  'cols': [0.0, 0.5, 0.75, 1.0]
}

Using set_layout with this value will result in a 3x2 layout where all column separators span both rows.

@adzenith
Copy link
Member

What would the user interface for this look like?

@markalfred
Copy link
Author

The basic idea is like this...

http://youtu.be/T0QePhICeeY

I think an assumption could be made that any adjacent panes sharing the exact same x or y separator positions could be consolidated.

@adzenith
Copy link
Member

Does that code exist? Want to send a pull request?

@markalfred
Copy link
Author

It's a fake currently 😊 but I'd be happy to start work on the idea if anyone has use for / interest in it.

@adzenith
Copy link
Member

Sure! I was also thinking that it could automatically consolidate when new panes are made - so if you created the upper-right pane and then the lower-right pane, they'd auto-consolidate. And this way if you dragged the divider for the upper-right one before creating the lower right, they wouldn't consolidate. What do you think?

@markalfred
Copy link
Author

Very good call!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants