Fix folding/unfolding selected composite task is not working

This commit is contained in:
Serhii Snitsaruk 2024-06-06 12:58:18 +02:00
parent 2d1c5fa4ba
commit d6076d131f
No known key found for this signature in database
GPG Key ID: A965EF8799FFEC2D
1 changed files with 2 additions and 1 deletions

View File

@ -384,7 +384,8 @@ void TaskTree::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_READY: { case NOTIFICATION_READY: {
tree->connect("item_mouse_selected", callable_mp(this, &TaskTree::_on_item_mouse_selected)); tree->connect("item_mouse_selected", callable_mp(this, &TaskTree::_on_item_mouse_selected));
tree->connect("item_selected", callable_mp(this, &TaskTree::_on_item_selected)); // Note: CONNECT_DEFERRED is needed to avoid double updates with set_allow_reselect(true), which breaks folding/unfolding.
tree->connect("item_selected", callable_mp(this, &TaskTree::_on_item_selected), CONNECT_DEFERRED);
tree->connect("item_activated", callable_mp(this, &TaskTree::_on_item_activated)); tree->connect("item_activated", callable_mp(this, &TaskTree::_on_item_activated));
tree->connect("item_collapsed", callable_mp(this, &TaskTree::_on_item_collapsed)); tree->connect("item_collapsed", callable_mp(this, &TaskTree::_on_item_collapsed));
} break; } break;