-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Don't emit changed signal on Color Picker close #44895
Conversation
Well, I think you should test it with VisualShader's Color constant node - when the color picker popup is going to close it should apply its color to the node. |
Alright, then, I'm fine with it. |
@@ -2191,7 +2187,6 @@ EditorPropertyColor::EditorPropertyColor() { | |||
add_child(picker); | |||
picker->set_flat(true); | |||
picker->connect("color_changed", callable_mp(this, &EditorPropertyColor::_color_changed)); | |||
picker->connect("popup_closed", callable_mp(this, &EditorPropertyColor::_popup_closed)); |
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.
There's now nothing connected to the popup_closed
signal.
It used to be emitted when receiving modal_closed
, which happens when the ColorPicker popup receives NOTIFICATION_MODAL_CLOSE
. Are you sure that this doesn't trigger in situations where you might still want to validate the input?
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.
Are you sure that this doesn't trigger in situations where you might still want to validate the input?
That could only happen when you modify the color without triggering _color_changed()
and then close the popup. AFAIK it's not possible.
Thanks! |
Cherry-picked for 3.2.4. |
I just noticed that #40879 is still not fixed (although I'm pretty sure I tested the PR). The culprit was the
_popup_closed
method in EditorPropertyColor. It emitted the modified signal every time the color picker popup was closed, which is just dumb. Even if it was necessary for something, looks like_color_changed()
is called anyways when the popup is closed, which resulted in doubleset
calls when the color was modified:btw I inspected the
_color_changed()
call on close and it seems to be called with a slightly different color. Dunno what is it, maybe ColorPicker doesn't set proper RGB value and it's corrected (rounded?) on close.