-
-
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
Added ability to unfold editor sections when dragging and dropping. #41138
Added ability to unfold editor sections when dragging and dropping. #41138
Conversation
ffd211b
to
fc5d2e4
Compare
Does this code also give the ability to expand all the folds for a specific property? Was trying to get that to work. |
All the folds for a specific property? Not sure what you mean by that, could you clarify if possible? |
So I have a property albedo_texture, but it's hidden inside of a "Albedo" group. So I want to show the albedo texture from code, but it's nested and the group nearest to it is not related because albedo_texture is a top level property (like without "/"). [Edited] I think that is a different issue unrelated, looking at your code. |
Ah yeah I think I understand what you mean. Like if you had:
You want to be able to unfold Section 1 and 2 by querying to say "unfold all sections for 'property'". This PR hasn't got anything to do with that functionality, no. |
Is it possible to set a highlight on the section? Currently there's no visual feedback. [Edited] It's more complicated. Not sure if it's worth setting the highlight on drop and then when you move away set a timer to unset the highlight. However, it's worth trying to show activity. |
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
@fire It might actually be worth implementing a highlight whenever a user hovers over a section, no matter if they are dragging or not. I think that would be another PR tho. |
fc5d2e4
to
618e8aa
Compare
@@ -231,6 +231,9 @@ class EditorInspectorSection : public Container { | |||
Color bg_color; | |||
bool foldable; | |||
|
|||
Timer *dropping_unfold_timer; |
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.
= nullptr.
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.
Sorry, I don't understand. memnew(Timer)
is used in the constructor. Why does it need = nullptr
? That is not used anywhere else in the codebase where a Timer*
is defined.
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.
godot/modules/mono/csharp_script.h
Line 364 in b2096ba
ManagedCallableMiddleman *managed_callable_middleman = memnew(ManagedCallableMiddleman); |
Timer *dropping_unfold_timer = memnew(Timer);
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.
Yeah so that's in the header, I'm saying the timer is initialised in the constructor:
https://github.com/godotengine/godot/pull/41138/files#diff-554c9c97362d5a6f63b7244253542ffeR1312
I'm just wondering why this needs to explicitly specify = nullptr
when I can't seem to find that happening anywhere else in the codebase. For example:
Line 44 in d3b5c09
Timer *range_click_timer; |
It is then initialised in the constructor:
Lines 272 to 274 in d3b5c09
range_click_timer = memnew(Timer); | |
range_click_timer->connect("timeout", callable_mp(this, &SpinBox::_range_click_timeout)); | |
add_child(range_click_timer); |
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.
I don't remember exactly, but every so often Akien runs a script that moves the construction stuff to initialization.
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.
Ah ok, no worries. I was just wondering if there was some convention as I couldn't see other cases of this being used.
I have an old PR (#39650) that implements unfolding with highlighting. Without highlighting it's hard to know that you can even unfold. Also, if you look at the code you can see it is not that much work, so I think you should add it to your PR. |
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
618e8aa
to
b34a7b5
Compare
b34a7b5
to
de7f8a9
Compare
Sorry... forgot to rebase before pushing so some unnecessary reviewers were added. Apologies. They can be removed if a mod sees this and can do so. |
de7f8a9
to
484c951
Compare
484c951
to
24eeb89
Compare
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Looks great. [Tested on my backport to 3.2.] |
Also added editor setting to control the delay used before unfold occurs.
24eeb89
to
7cc1b0f
Compare
Thanks! |
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs. Co-authored-by: Eric M <itsjusteza@gmail.com> godotengine/godot#41138
Also added editor setting to control the delay used before unfold occurs.
Closes #37524
Edit: oh, and I also cleaned up the
gui_input()
function a bit. Everything it was doing is encapsulated inunfold()
andfold()
, so we might as well use those functions since they are there. Now the code is much easier to follow. It's basically justshould_unfold ? unfold() : fold()