summaryrefslogtreecommitdiff
path: root/editor/settings_config_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/settings_config_dialog.cpp')
-rw-r--r--editor/settings_config_dialog.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index d75ef5df8a..f50f9f6f5f 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"));
@@ -263,7 +277,7 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column
Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(item);
if (p_idx == 0) {
- press_a_key_label->set_text(TTR("Press a Key.."));
+ press_a_key_label->set_text(TTR("Press a Key..."));
last_wait_for_key = Ref<InputEventKey>();
press_a_key->popup_centered(Size2(250, 80) * EDSCALE);
press_a_key->grab_focus();
@@ -457,7 +471,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
add_child(press_a_key);
Label *l = memnew(Label);
- l->set_text(TTR("Press a Key.."));
+ l->set_text(TTR("Press a Key..."));
l->set_anchors_and_margins_preset(Control::PRESET_WIDE);
l->set_align(Label::ALIGN_CENTER);
l->set_margin(MARGIN_TOP, 20);