diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-08-18 22:48:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-18 22:48:29 +0200 |
commit | 8bc9986db4a91a35e8c540b2b3cfbe81b2f2e1e6 (patch) | |
tree | e6468eceb035c0c845bf42774b146aa6778fefbf | |
parent | 92401772c859207130aafcd0f2d24236600d76e0 (diff) | |
parent | 17b439844da7fa1460914c839240157d847a8f85 (diff) |
Merge pull request #21155 from ordigdug/fix-colorpicker-popup
Fixes colorpicker popup immeditately closing when interacting with co…
-rw-r--r-- | editor/editor_properties.cpp | 9 | ||||
-rw-r--r-- | editor/editor_properties.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 68d1d689e0..1c1d72e7d1 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -1734,12 +1734,18 @@ EditorPropertyTransform::EditorPropertyTransform() { void EditorPropertyColor::_color_changed(const Color &p_color) { - emit_signal("property_changed", get_edited_property(), p_color); + emit_signal("property_changed", get_edited_property(), p_color, true); +} + +void EditorPropertyColor::_popup_closed() { + + emit_signal("property_changed", get_edited_property(), picker->get_pick_color(), false); } void EditorPropertyColor::_bind_methods() { ClassDB::bind_method(D_METHOD("_color_changed"), &EditorPropertyColor::_color_changed); + ClassDB::bind_method(D_METHOD("_popup_closed"), &EditorPropertyColor::_popup_closed); } void EditorPropertyColor::update_property() { @@ -1757,6 +1763,7 @@ EditorPropertyColor::EditorPropertyColor() { add_child(picker); picker->set_flat(true); picker->connect("color_changed", this, "_color_changed"); + picker->connect("popup_closed", this, "_popup_closed"); } ////////////// NODE PATH ////////////////////// diff --git a/editor/editor_properties.h b/editor/editor_properties.h index d5fac9c1a0..ea107d76b0 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -476,6 +476,7 @@ class EditorPropertyColor : public EditorProperty { GDCLASS(EditorPropertyColor, EditorProperty) ColorPickerButton *picker; void _color_changed(const Color &p_color); + void _popup_closed(); protected: static void _bind_methods(); |