diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-04-08 09:02:44 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-08 09:02:44 -0300 |
commit | 8a84f9df0d1f487f0a36f42171cf68e8800e04d4 (patch) | |
tree | adb58a94467f16b0a30b8670e8d9ebff52f8b460 | |
parent | 9e7cee2ceb1a963c1da2c21013adf7d616412d3c (diff) | |
parent | eda1e266c87fc56ab9f1edbbb06785072a021dca (diff) |
Merge pull request #17741 from Essojadojef/fix-shortcut-categories
Fix all categories unfold when one key binding is changed
-rw-r--r-- | editor/settings_config_dialog.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index d75ef5df8a..36d7a83930 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -199,6 +199,14 @@ void EditorSettingsDialog::_update_icons() { void EditorSettingsDialog::_update_shortcuts() { + Map<String, bool> collapsed; + + if (shortcuts->get_root() && shortcuts->get_root()->get_children()) { + for (TreeItem *item = shortcuts->get_root()->get_children(); item; item = item->get_next()) { + collapsed[item->get_text(0)] = item->is_collapsed(); + } + } + shortcuts->clear(); List<String> slist; @@ -223,7 +231,13 @@ void EditorSettingsDialog::_update_shortcuts() { section = sections[section_name]; } else { section = shortcuts->create_item(root); - section->set_text(0, section_name.capitalize()); + + String item_name = section_name.capitalize(); + section->set_text(0, item_name); + + if (collapsed.has(item_name)) { + section->set_collapsed(collapsed[item_name]); + } sections[section_name] = section; section->set_custom_bg_color(0, get_color("prop_subsection", "Editor")); |