Use SplitContainer for Node3D Editor viewports#117203
Merged
Repiteo merged 1 commit intogodotengine:masterfrom Mar 9, 2026
Merged
Use SplitContainer for Node3D Editor viewports#117203Repiteo merged 1 commit intogodotengine:masterfrom
Repiteo merged 1 commit intogodotengine:masterfrom
Conversation
ryevdokimov
approved these changes
Mar 8, 2026
Contributor
There was a problem hiding this comment.
Works. Tested all the different configurations, spacing presets and touch screen.
Code looks fine to me.
The exact viewport that is used for certain positions in some layouts have changed a bit, but I don't think it is that important to keep the same.
I believe this will affect how viewport state is reloaded when people upgrade, but this is a onetime annoyance, and I don't think worth worrying about.
Quick Demo:
2026-03-08.15-00-34.mp4
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous approach for the Node3D Editor's viewport container had some issues:
separationbut grabbing did not account forminimum_grab_thickness. This made it more difficult to grab.These could be fixed on their own, but it is better to just use SplitContainer to handle all of it.
I changed it to use 3 SplitContainers, one main one and two children. I change their vertical flags when needed to fit the different layouts.
I also made sure that the horizontal/vertical positions would remain the same when switching layouts like before.
These use the new drag nested intersections SplitContainer option so you can still adjust multiple at once. Also you can drag the intersection between one of these and the docks now. related godotengine/godot-proposals#14300
The four-way works by disabling the first child split and using the second child's drag margin to expand it over the first, and setting the first child split offset to follow.
I set minimum size of viewports to 39. This is the value I got when I minimized them on master, not sure why that value or where it is from, but it keeps the behavior the same.
Removed the 3-way and 4-way grabber icons. Drag nested intersections handles it by showing both regular grabber icons instead.
The 3-way icons had another issue too, sometimes it was not aligned correctly. Related #74691
The exact viewport that is used for certain positions in some layouts have changed a bit, but I don't think it is that important to keep the same. 2 viewports (including alt) now use indexes 0 and 1 instead of 0 and 2, and 3 viewports alt now uses 0,1,2 instead of 0,2,3.
I also fixed an issue in SplitContainer where enabling the touch dragger didn't hide it if dragging was disabled until it was sorted, it now updates immediately. Otherwise in the four way, it would show incorrectly for the first split until it gets updated.