diff options
author | kobewi <kobewi4e@gmail.com> | 2023-01-22 19:24:11 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2023-01-22 19:24:11 +0100 |
commit | b8493dca823232f13eb21ecd976276c3187d2c25 (patch) | |
tree | b667dfa969dcdd4e0df12266e3b2b78d9c1e912c | |
parent | eaf306e0b15e4283883f06bf903b05711a4dbfe8 (diff) |
Reselect signal after tree update
-rw-r--r-- | editor/connections_dialog.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 9ff480f130..7905dde913 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -985,6 +985,10 @@ void ConnectionsDock::set_node(Node *p_node) { } void ConnectionsDock::update_tree() { + String prev_selected; + if (tree->is_anything_selected()) { + prev_selected = tree->get_selected()->get_text(0); + } tree->clear(); if (!selected_node) { @@ -1076,7 +1080,14 @@ void ConnectionsDock::update_tree() { // Create the children of the subsection - the actual list of signals. TreeItem *signal_item = tree->create_item(section_item); - signal_item->set_text(0, String(signal_name) + signaldesc); + String signame = String(signal_name) + signaldesc; + signal_item->set_text(0, signame); + + if (signame == prev_selected) { + signal_item->select(0); + prev_selected = ""; + } + Dictionary sinfo; sinfo["name"] = signal_name; sinfo["args"] = argnames; |