mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add visibility check in color_picker.cpp
Check that the Color Picker Popup is currently visible inside the tree before resetting the color and emitting popup_closed.
This commit is contained in:
parent
06827c91c6
commit
3d0daf15e1
1 changed files with 7 additions and 5 deletions
|
|
@ -2442,12 +2442,14 @@ void ColorPickerButton::_color_changed(const Color &p_color) {
|
|||
}
|
||||
|
||||
void ColorPickerButton::_modal_closed() {
|
||||
if (picker->is_visible_in_tree()) {
|
||||
if (Input::get_singleton()->is_action_just_pressed(SNAME("ui_cancel"))) {
|
||||
set_pick_color(picker->get_old_color());
|
||||
emit_signal(SNAME("color_changed"), color);
|
||||
}
|
||||
emit_signal(SNAME("popup_closed"));
|
||||
set_pressed(false);
|
||||
}
|
||||
if (!get_tree()->get_root()->is_embedding_subwindows()) {
|
||||
get_viewport()->set_disable_input(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue