-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Apply set_read_only()
to child classes of EditorProperty
elements
#51722
Apply set_read_only()
to child classes of EditorProperty
elements
#51722
Conversation
1c7fc10
to
425fea3
Compare
4f8abcb
to
0f9ed37
Compare
Disabled properties should have revert arrow unavailable probably. EDIT: EDIT2: Also I don't see any way to disable selected properties, only whole inspector can be disabled. This would be useful. |
0f9ed37
to
3afcc2b
Compare
The revert button is now hidden when As for LayerGrid and Ease, the input processing is implemented in
I think it is necessary to separate methods such as The rest is a matter of style color. Edited: |
2a8c189
to
7052b50
Compare
87d0b8e
to
a5e527c
Compare
@groud In other words, the only thing we need to implement here is a virtual function called EditorProperty->set_editable(!(EditorProperty->is_readonly() || EditorInspector->is_readonly())); should I do this, right? |
Not really, no. To make it clear, this PR has a lot of collisions with #30623. That PR adds a PROPERTY_USAGE_READ_ONLY flag that is used to determine if a property is read_only or not. You should add it in this PR too, and then, when building the tree, you should do something like:
|
@groud
|
I am not sure what you mean, the flag is added to
I don't think why you would need that anyway. It's not a reliable way to identify EditorProperty nodes (at least in the inspector). If you need something more complex than using the default way the inspector does things (by creating EditorProperties out of the list of property), then you need to code the logic inside an inspector plugin. Otherwise, simply updating the nodes properties with the correct flags (in |
1096ca3
to
22135c7
Compare
@groud Thank you for the explanation, now I understood it somehow. For example, the current Fixed:
|
It seems correct. I am not very familiar with how Otherwise you may add a setter for a new property within Skeleton3D, that would only impact whether or not part of its properties are read-only. |
22135c7
to
15087fb
Compare
3062f95
to
e07d91f
Compare
58917a9
to
1777035
Compare
1777035
to
ec2c636
Compare
ec2c636
to
facf8f1
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.
Alright, LGTM
Thanks! |
Fixed #45769.
The
read_only
flag is inEditorProperty
, so you can use it in the child classes ofEditorProperty
. According to the description, theread_only
flag prevents operations in the inspector. However, if you don't setread_only
for each GUI element implemented in the child class, they can manipulate the value in the inspector even ifread_only == true
.Currently, it seems that the
read_only
flag is not commonly used, but for example, in #45699, it is necessary thatread_only
works correctly to prevent handling BonePose in RestMode. Also, theread_only
flag can only be set in C++ currently, but it may be used in GDScript in the future with some way. So I fixed this.2021-08-16.17.13.24.mov