Skip to content

Commit

Permalink
Gamestate Inspector: Recursively fold
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Oct 31, 2016
1 parent 26a1eb3 commit b849aa3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/dialogs/gamestate_inspector.cpp
Expand Up @@ -322,10 +322,13 @@ class tgamestate_inspector::controller
ttree_view_node* selected = dynamic_cast<ttree_view&>(tree).selected_item();
callbacks[selected->describe_path()](*selected);

// We recursively fold, but non-recursively unfold.
// This is because only one node on a level should be open at any given time.
// Furthermore, there's no need to remember that a subnode was open once the parent is closed.
if(!selected->is_root_node()) {
for(auto& node : selected->parent_node().children()) {
if(&node != selected) {
node.fold();
node.fold(true);
}
}

Expand Down

0 comments on commit b849aa3

Please sign in to comment.