diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-03-10 12:49:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 12:49:27 +0100 |
commit | 90faf04f293fcdf636f641bfe3d88c5857695d9b (patch) | |
tree | 506b5509f89c24ead8e88722f8a4d0458db8f970 | |
parent | 420982dfeb5e41a09aaf78e29b6f1c32dcbe38be (diff) | |
parent | 472c6cbfdc6269c096fc6891b85ca424e08300c8 (diff) |
Merge pull request #56476 from gerhean/fix_shortcut_collapse_after_edit
-rw-r--r-- | editor/editor_settings_dialog.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 8ecdcfff65..c0113e281e 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -338,13 +338,15 @@ void EditorSettingsDialog::_update_shortcuts() { // Try go down tree TreeItem *ti_next = ti->get_first_child(); - // Try go across tree + // Try go to the next node via in-order traversal if (!ti_next) { - ti_next = ti->get_next(); - } - // Try go up tree, to next node - if (!ti_next) { - ti_next = ti->get_parent()->get_next(); + ti_next = ti; + while (ti_next && !ti_next->get_next()) { + ti_next = ti_next->get_parent(); + } + if (ti_next) { + ti_next = ti_next->get_next(); + } } ti = ti_next; |