Sort properties by name in the GUI

This commit is contained in:
Alexander Bock
2016-10-28 11:46:14 +02:00
parent f8bab90d64
commit cfd71d6c8d

View File

@@ -102,7 +102,14 @@ void GuiPropertyComponent::render() {
ImGui::Spacing();
if (_function) {
const std::vector<properties::PropertyOwner*>& owners = _function();
std::vector<properties::PropertyOwner*> owners = _function();
std::sort(
owners.begin(),
owners.end(),
[](properties::PropertyOwner* lhs, properties::PropertyOwner* rhs) {
return lhs->name() < rhs->name();
}
);
for (properties::PropertyOwner* pOwner : owners) {
if (pOwner->propertiesRecursive().empty())