Page MenuHome

UI Experiment: Extended Simple Area Joins
AbandonedPublic

Authored by Harley Acheson (harley) on Jun 7 2020, 1:58 AM.

Details

Reviewers
None
Summary

This is just an experiment for testing purposes.

Until fairly recently, joining screen areas required that the edges of those areas line up exactly (as seen in the left of the following image). But that requirement has been relaxed somewhat over the last year and we can now join areas that are bit misaligned (as shown in the second and third image below):

This patch is part of experiments in relaxing that alignment requirement much further. In fact it largely tosses out the test for near-alignment and instead uses different types of tests to see if the join is possible. It can let you do some very disparate joins between the areas, like those shown below:

For just the default layout, the new joins you can do are highlighted below with yellow:

What is required for joining?

  • the two areas must share part of one edge, but only for a small distance (about double the height of a header)
  • the areas have to be able to join without removing any other area
  • the areas have to be able to be joined simply, without needing to split any participant first.
  • the areas have to have edges that are oriented to allow them to be joined and aligned.

This seems like a long list, but the practical result is that if two areas can be joined somehow then they will be joined. You will only get the "stopsign" while attempting a join when it really isn't possible to do so without some drastic action like bisecting or subsuming some other area.

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Jun 7 2020, 1:58 AM
Harley Acheson (harley) created this revision.
Harley Acheson (harley) edited the summary of this revision. (Show Details)Jun 7 2020, 2:28 AM

Bug

And I fixed that (seems like it's true for now), though in a completely different way. Now I just need to make all looking good (I mean code).
If u will plan to work on that and didn't saw my cod, first let me know, please

(sorry for audio)

@Ilya Shurupov (Hto-Ya) - Thanks!

This (experimental) patch introduces two tests to see if a join can occur. The first makes certain that the bounds around the two areas do not include an entire other area - portions of any any number of areas are fine, just not entire areas - so that other areas are not destroyed. The second test makes sure that the areas are arranged in a way that merging is possible in that the screen edges are where I need them to and are in the correct direction.

The good news is that the examples you show are covered by the second test. That test just isn't doing its job sufficiently because of a test that is too lazy. I am checking to see if there is a screen edge in the correct direction overlapping a particular point, but only checking in one direction and not bothering with the start and ending of the thing. I left it like that (for now) because I first have to track down a different issue that makes that test more complicated than it needs to be.

Anyway, thanks again!

Found my off-by-one error and so have completed the impartial test that had caused some errors.

Therefore the failing examples supplied by @Ilya Shurupov (Hto-Ya) no longer crap out.

It's working too well. So I have have reduced the amount that two areas much share an edge down to the height of a header, which means the smallest and largest areas possible can merge - assuming they are in an arrangement where it is possible.

For example, starting with the default layout, you can drag Timeline to minimum, then reduce Outliner to minimum....

Then you can join the mazimized 3D View to the minimized Outliner:

Harley Acheson (harley) edited the summary of this revision. (Show Details)Jun 9 2020, 5:23 AM

If we are talking about ALL CSES when user can join two areas without the need to move edges, then your Patch is not doing that work, for now, maybe.
In the video below, u can see the difference between our implementations

U can see my code here https://developer.blender.org/D7970

For now, I just want to clarify, that I'm only interested in a good joining operator, so if u will come up with a better solution (in terms of simplicity of implementation) that will be fantastic.
And I just want to avoid wasted time, my and yours.

@Ilya Shurupov (Hto-Ya) - Thanks! Yes, I can see where my test is more restrictive than is strictly necessary.

Will look closely at yours.

Greatly simplified, better comments, and even more more permissive.

Simplified a bit more. Added a short-circuit for perfectly-aligned areas.

Getting in a shape for more experimentation.

Things are still working well, so I thought I'd add some complication by handing an easy corner case.

There is one type of join that looks easy but is not, because it cannot be done by a simple movement of edges. For the join shown on the left below, just moving the edges to join A to B will result in the deletion of C. But because, in this case, C is joinable with A we can add an area swap into the mix and end up with what is shown on the right:

Note that is does not allow the reverse, a join from B to A, since that would a split as part of the process.

Backtracked a bit and changed the orientation on those joins. It feels more like the expected behavior. And doing it this way (with an extra split in the process rather than an extra join) means that it works in both directions so covers every part of this join type.

Everything still testing nicely. Updated to current state of master, simplified more, better comments.

Small misc changes.

Wow, looks like the changes here are leapfrogged by @Ilya Shurupov (Hto-Ya)'s code in here: https://developer.blender.org/D7970

Needs some testing, but sure looks like it can join any two neighboring areas regardless of how they (and all their neighbors) are arranged. So I might have to plan on helping him with his instead.

Some possible configurations were not allowed to join because of some "off-by-one" errors in a test.

More simplification

Better organized, better comments, easier to understand.

Now with an "Area Close" operator, found on the header context menu.

Experiments done. Abandoning in favor of https://developer.blender.org/D8084