-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Improvements to SplitContainer including a drag bar background StyleBox #72680
Improvements to SplitContainer including a drag bar background StyleBox #72680
Conversation
27eaf38
to
6848051
Compare
6848051
to
dd8e5d9
Compare
That's a lot. It needs a proposal, or several, to explain various enhancements. Probably better done as several PRs too, but that would be more obvious after the proposals. |
Okay. I’ll put the proposal together and follow up as necessary.
… On Feb 3, 2023, at 2:13 PM, Yuri Sizov ***@***.***> wrote:
That's a lot. It needs a proposal, or several, to explain various enhancements. Probably better done as several PRs too, but that would be more obvious after the proposals.
—
Reply to this email directly, view it on GitHub <#72680 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AIDFM5F5VVVVTRXIMFRQZWDWVVRG7ANCNFSM6AAAAAAUQR3F4M>.
You are receiving this because you authored the thread.
|
Needs rebase.
You can also connect |
I just tried these, and If there are still issues with the |
Yeah right now the signal is not needed for anything. It's also inconsistent with other containers which don't expose anything like this. |
dd8e5d9
to
0607c60
Compare
This push included a rebase and removed the |
dc48cd1
to
d661619
Compare
Can you show an example when this is useful? The child nodes of SplitContainer can't be shrunk past their minimum size, so it's impossible to overlap scrollbars and drag area.
Isn't
Which video?
Shouldn't this be editor-only? Also the double |
This comment was marked as resolved.
This comment was marked as resolved.
805ea5b
to
2cce2aa
Compare
@kitbdev All the changes we discussed were made - thanks for the excellent suggestions! |
Sorry for the delay following up. |
Sounds good. I will take care of the conflicts shortly. |
2cce2aa
to
8ae0b1f
Compare
In reference to #90411, there is quite a bit of overlapping effort (and similar thinking) in cleaning up |
CC @kitbdev |
I don't think there is much overlap in cleaning up SplitContainer, besides some minor doc issues. #90411 just needs to touch a lot of things due to logic changes. Where they do clean up, they clean up different things like #90411 needs some fixes to properly handle changing child visibility, so it isn't ready yet, and I don't want to hold up other PRs. |
f9946ba
to
40e25ad
Compare
Thanks for offering to rebase on top of this. I did put the draw back into the dragger, and I see now why it needs to be there so you can have multiple dragger instances with more than two children. Each dragger now also saves its stylebox |
0c76e98
to
ca935ff
Compare
319f82b
to
20b6755
Compare
20b6755
to
f7005de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I still wish there was a better way to do the drag_area_highlight_in_editor
than exposing it.
Thanks! |
Improves
SplitContainer
in a number of ways making it much easier to script, and tidies up the code as follows:split_bar_background
StyleBox
allows solid color, gradients or textures to fill in the split bar behind or in place of the grabber icon.drag_area_scrollbar_offset
is required if one of the child controls has a scrollbar or other selectable control up against the split bar, in order to prevent the drag area from blocking mouse selection of the scroll bar or control.drag_started
anddrag_released
make it easier to script saving and restoring thesplit_offset
dragging_enabled
separates dragging fromdragger_visibility
so the appearance of the drag bar is independent from whether dragging is enabled or not.get_drag_area_control
returns theControl
so buttons or any other type ofControl
can ride along with the split bar (see demo video below).drag_area_margin_begin
anddrag_area_margin_end
allow for scripting the long-axis size of the drag area and background, which makes some nice uses like drawers simple to script (see video below).drag_area_highlight_in_editor
property allows you to see the drag area during development.- A new virtual method_splits_ready()
with a corresponding signal so a script knows when the split container children have been resized after the initial sort. This was a big problem because formerly,SplitContainer._ready()
was called before the children had been fit to the container, and there was no easy way to get that information.This PR also fixes this issue and adds the theme fix: #71862 and #71861
Adds this enhancement #61534
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.36.25.PM.mov
Screen.Recording.2023-02-03.at.12.40.10.PM.mov
Here's the editor with the drag areas visible:
Screen.Recording.2023-02-03.at.12.58.21.PM.mov
Production edit: Closes #61534, closes godotengine/godot-proposals#6230 and closes godotengine/godot-proposals#6231.