-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Improve SplitContainer grab area by adding margin properties and exposing the Control to scripting #6231
Comments
I'm not sure if your feedback and contribution here addresses this, but I agree that splits need to expose more of their dragging area stuff to scripting. currently trying to implement a pull-down drawer on mobile, and it's virtually impossible with the world's smallest drag touch area at the top of the screen. simple access to that control would help immensely |
If you can describe a little more detail about what you're trying to do, I can tell you if the PR can help - it's intended to address all of the deficiencies in the split container. |
Basically, it would be great to be able to define the width of a split's drag handle (possibly even separately from how it's rendered) because it is a nightmare trying to manipulate a split container on a phone. touch controls are pretty inaccurate so it would be nice to be able to give fat fingers like my own a chance at grabbing one of these bad boys |
There’s a new theme constant in Godot 4, even without this PR, that gives you a grab area separate from the split width. If you are able to try out Godot 4, you’ll be able to experiment with it. This PR proposes the ability to offset that grab area, but you might not need that for your project. Hope this helps.
|
ah thanks, i did not know that. unfortunately im stuck with Godot 3 because of C# android support, but then i will wait patiently |
There’s a Godot 4 build for C# - see the latest beta news item.
|
yes I know there is and I'd jump on the opportunity to upgrade but unfortunately it seems that Android is currently an unsupported build target with C# (possibly due to issues upstream) /: |
Describe the project you are working on
GUI elements for handling large collections of items, and GUI elements for organizing related containers of text, lists and collections - common GUI utility used frequently.
Describe the problem or limitation you are having in your project
Because you can't access the grab area
Control
, and there is no way to modify the span of the split bar accross the SplitContainer, a lot of ungainly scripting code is required to implement a few highly useful variations of SplitContainers.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Control
used by the new grab area in SplitContainer, makes adding buttons to the split bar a matter of a few lines of code.drag_area_margin_begin
anddrag_area_margin_end
properties, useful combinations of SplitContainers can be created with a few lines of code, such as "drawers" that collapse against at the top, bottom or side of a parent container.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The code is complete per PR #72680
The PR combines this proposal with proposal #6230, with fixes various issues with SplitContainer that make scripting difficult.
Screen.Recording.2023-02-03.at.12.29.31.PM.mov
This is all the GDScript neccessary for the buttons:
Screen.Recording.2023-02-03.at.12.40.10.PM.mov
If this enhancement will not be used often, can it be worked around with a few lines of script?
Extremely difficult to implement in script - all of the visual split bar elements have to be drawn over a split container with dragging disabled, and the script has to set the offset when the overlaid control is dragged.
Is there a reason why this should be core and not an add-on in the asset library?
These two enhancements are small modifications to split_container.cpp, but greatly improve it's utility.
The text was updated successfully, but these errors were encountered: