소스 검색

Fix shortcut collapse after edit

Ger Hean 3 년 전
부모
커밋
472c6cbfdc
1개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 8 6
      editor/editor_settings_dialog.cpp

+ 8 - 6
editor/editor_settings_dialog.cpp

@@ -327,13 +327,15 @@ void EditorSettingsDialog::_update_shortcuts() {
 
 
 			// Try go down tree
 			// Try go down tree
 			TreeItem *ti_next = ti->get_first_child();
 			TreeItem *ti_next = ti->get_first_child();
-			// Try go across tree
+			// Try go to the next node via in-order traversal
 			if (!ti_next) {
 			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;
 			ti = ti_next;