Reselect signal after tree update
This commit is contained in:
parent
eaf306e0b1
commit
b8493dca82
1 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue