diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-07-17 16:14:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-17 16:14:10 +0200 |
commit | abfa4b822bef869acbebb55e1659174623c3815e (patch) | |
tree | 84b10f754374001c668074eb3a342d9b816b3077 /editor | |
parent | e57e53debb4e13c0a5182542b0066ed5b37b2447 (diff) | |
parent | 4966bb5c67590465a6588c43a903f895a0987f5f (diff) |
Merge pull request #18717 from Essojadojef/fix-inputmap-categories
Fix all Input Map actions expand when an event is modified
Diffstat (limited to 'editor')
-rw-r--r-- | editor/project_settings_editor.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 8c7565a441..7e4e589bb4 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -394,6 +394,7 @@ void ProjectSettingsEditor::_show_last_added(const Ref<InputEvent> &p_event, con while (child) { Variant input = child->get_meta("__input"); if (p_event == input) { + r->set_collapsed(false); child->select(0); found = true; break; @@ -654,6 +655,14 @@ void ProjectSettingsEditor::_update_actions() { if (setting) return; + Map<String, bool> collapsed; + + if (input_editor->get_root() && input_editor->get_root()->get_children()) { + for (TreeItem *item = input_editor->get_root()->get_children(); item; item = item->get_next()) { + collapsed[item->get_text(0)] = item->is_collapsed(); + } + } + input_editor->clear(); TreeItem *root = input_editor->create_item(); input_editor->set_hide_root(true); @@ -677,6 +686,8 @@ void ProjectSettingsEditor::_update_actions() { TreeItem *item = input_editor->create_item(root); item->set_text(0, name); item->set_custom_bg_color(0, get_color("prop_subsection", "Editor")); + if (collapsed.has(name)) + item->set_collapsed(collapsed[name]); item->set_editable(1, true); item->set_cell_mode(1, TreeItem::CELL_MODE_RANGE); |