From 993ae871c760fb527fc5caa531a284dc394ce772 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Wed, 9 Sep 2020 21:38:29 +0300 Subject: Fix ColorPickerButton to apply changes after picker popup closed --- scene/gui/color_picker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scene/gui') diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index fafbb298b7..cbe0367c7b 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -873,6 +873,7 @@ void ColorPickerButton::_color_changed(const Color &p_color) { void ColorPickerButton::_modal_closed() { emit_signal("popup_closed"); + set_pressed(false); } void ColorPickerButton::pressed() { @@ -976,9 +977,8 @@ void ColorPickerButton::_update_picker() { popup->add_child(picker); add_child(popup); picker->connect("color_changed", callable_mp(this, &ColorPickerButton::_color_changed)); - popup->connect("modal_closed", callable_mp(this, &ColorPickerButton::_modal_closed)); popup->connect("about_to_popup", callable_mp((BaseButton *)this, &BaseButton::set_pressed), varray(true)); - popup->connect("popup_hide", callable_mp((BaseButton *)this, &BaseButton::set_pressed), varray(false)); + popup->connect("popup_hide", callable_mp(this, &ColorPickerButton::_modal_closed)); picker->set_pick_color(color); picker->set_edit_alpha(edit_alpha); emit_signal("picker_created"); -- cgit v1.2.3