-
-
Notifications
You must be signed in to change notification settings - Fork 104
Drag nested SplitContainers at intersection #14300
Description
Problem or limitation
Dragging multiple SplitContainers in the editor takes more clicks than it needs to. It is not possible to move multiple SplitContainers at the same time, so moving 2 of them requires dragging them independently. Some other applications allow dragging multiple splits at their intersection, moving 3 panels at once.
For instance, if you want to expand one dock in particular, you need to separately resize its height and width.
Also when using 3 or 4 viewports in the 3D editor, it is possible to drag the intersection for these, so it is somewhat inconsistent that you cannot do this with the rest of the editor.
The 3D viewport doesn't use SplitContainers for its multiple viewports, and it has some issues like the grab area being too small, no accessibility support, or no touch dragger support. I would expect it to have the same functionality as SplitContainers.
Proposed improvement
It is not too hard to do this with your own SplitContainers, you can add a Control child to the SplitContainer dragger with mouse filter pass and have it set the child SplitContainer's split_offset with gui events.
The tricky part is to make it work automatically with nested SplitContainers and making sure it updates correctly in all cases. and it would have to use not just the direct children for the Editor, since some SplitContainers are nested in other controls, like the center split container is in a VBoxContainer.
To make it automatically detect changes, SplitContainers need to check their ancestors for other SplitContainers and tell them to update when needed. This would then add children to the draggers to allow dragging both SplitContainers at once.
This would also be useful for users making UIs with multiple SplitContainers, so it could be exposed as an option.
I don't think these will need their own accessibility elements, and I don't think the accessibility action API would support them. I also don't think they should have their own touch draggers, adding them for each intersection would get busy and have overlaps.
The 3D viewport could be probably be refactored to use SplitContainers for better consistency once this feature is added.
I have a WIP:
drag-intersection-demo.mp4
Proposal review
- Yes, this proposal is highly specific and actionable.