Skip to content

Commit

Permalink
Resolve #4467: Clicking Entity Pane Columns for sorting cannot be undone
Browse files Browse the repository at this point in the history
New behaviour is to reset the sorting when the entity selection changes
  • Loading branch information
codereader committed Jan 27, 2017
1 parent 5d202c8 commit 9dff99d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libs/wxutil/TreeView.cpp
Expand Up @@ -92,6 +92,11 @@ void TreeView::ExpandTopLevelItems()
});
}

void TreeView::ResetSortingOnAllColumns()
{
ResetAllSortColumns();
}

void TreeView::AddSearchColumn(const TreeModel::Column& column)
{
// Only text columns are supported right now
Expand Down
3 changes: 3 additions & 0 deletions libs/wxutil/TreeView.h
Expand Up @@ -53,6 +53,9 @@ class TreeView :
// Expands the first level of all the top-level items
void ExpandTopLevelItems();

// Removes any sort keys
void ResetSortingOnAllColumns();

// Adds a column to search when the user starts typing
void AddSearchColumn(const TreeModel::Column& column);

Expand Down
3 changes: 3 additions & 0 deletions radiant/ui/einspector/EntityInspector.cpp
Expand Up @@ -1243,6 +1243,9 @@ void EntityInspector::changeSelectedEntity(const scene::INodePtr& newEntity)
// a chance to disconnect the list store might contain remnants
_keyValueIterMap.clear();
_kvStore->Clear();

// Reset the sorting when changing entities
_keyValueTreeView->ResetSortingOnAllColumns();

// Attach to new entity if it is non-NULL
if (newEntity)
Expand Down

0 comments on commit 9dff99d

Please sign in to comment.