Allow arbitrary ordering of nodes in the context menu #147
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
| ★ wanayoo — archive 1999 https://github.com/paceholder/nodeeditor/issues/147 | Nouvelle recherche | Portail wanayoo |
The ordering of nodes inside the DataModelRegistry is currently pretty arbitrary. When you open the context menu, the nodes are ordered by Category (sorted, as it uses
std::set), but within each category, there is no ordering. If I understand the code correctly, this is becauseRegisteredModelsCategoryMapis astd::unordered_map.I think it's beneficial to allow this ordering to be fully specified by a user of this library, or at least the order of nodes within any given category.
My proposal is thus the following:
unordered_mapregisterModel. Basically, use astd::vectorinstead of astd::set. It might be a good idea to add asortCategories()function. This is backwards incompatible, but I think it's valuable. If we want to stay backwards compatible, there should at least be a way to specify the order of the categories.The text was updated successfully, but these errors were encountered: