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

Make SplitContainer operate with more than 2 Control children. #10610

Closed
WhalesState opened this issue Aug 30, 2024 · 1 comment
Closed

Make SplitContainer operate with more than 2 Control children. #10610

WhalesState opened this issue Aug 30, 2024 · 1 comment

Comments

@WhalesState
Copy link

WhalesState commented Aug 30, 2024

Describe the project you are working on

N/A

Describe the problem or limitation you are having in your project

Complicated Scene Tree structure with a lot of remove_child and add_child calls to maintain a SplitContainer that can have more than two Control children.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It will help to simplify the SceneTree.

To achive the same result with SplitContainer your tree will look like:

Scene
├── SplitContainer
│   ├── First
│   ├── SplitContainer
│   ├── ├── Second
│   ├── ├── SplitContainer
│   ├── ├── ├── Third
│   ├── ├── ├── Forth

To achive the same result after implemention this feature:

Scene
├── SplitContainer
│   ├── First
│   ├── Second
│   ├── Third
│   ├── Forth

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I have already created SplitterContainer, but it still needs revision and support for child controls size flags and to be compatible with SplitContainer theme_cache.

splitter_container.h
splitter_container.cpp

Example:

30.08.2024_18.31.13_REC.mp4

If this enhancement will not be used often, can it be worked around with a few lines of script?

It can't, this will require a full rewrite of a new Container to support more children.

Is there a reason why this should be core and not an add-on in the asset library?

This will not break compatibility, because the SplitContainerDragger will be created/removed on demand instead of being a constant.
The only change is that the split_offset will be an Array instead of a Float and will be called split_offsets. We can keep both and we deprecate the first to not break compatibility.

@AThousandShips
Copy link
Member

AThousandShips commented Aug 30, 2024

Thank you for your proposal, consolidating in:

Which already has a PR, which is already approved and largely ready, if you are missing anything from that proposal please mention it, but it is very late in development

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

No branches or pull requests

2 participants