ui: improvements proposed by Julian Mautner
* automatically expand active class * increase arrow size * return child nodes in autocompletions * always return filters in autocompletions
This commit is contained in:
@@ -89,30 +89,16 @@ const std::set<std::shared_ptr<SearchNode>>& SearchNode::getChildren() const
|
||||
return m_nodes;
|
||||
}
|
||||
|
||||
SearchResults SearchNode::runFuzzySearch(const std::string& query, bool recursive) const
|
||||
SearchResults SearchNode::runFuzzySearch(const std::string& query) const
|
||||
{
|
||||
SearchResults result;
|
||||
|
||||
if (recursive)
|
||||
for (std::shared_ptr<SearchNode> n: m_nodes)
|
||||
{
|
||||
for (std::shared_ptr<SearchNode> n: m_nodes)
|
||||
FuzzyMap m = n->fuzzyMatchRecursive(query, 0, 0, 0);
|
||||
for (const std::pair<size_t, const SearchNode*>& p : m)
|
||||
{
|
||||
FuzzyMap m = n->fuzzyMatchRecursive(query, 0, 0, 0);
|
||||
for (const std::pair<size_t, const SearchNode*>& p : m)
|
||||
{
|
||||
result.insert(SearchResult(p.first, p.second, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::pair<size_t, size_t> p = fuzzyMatch(query, 0, 0);
|
||||
size_t pos = p.first;
|
||||
size_t weight = p.second;
|
||||
|
||||
if (pos == query.size())
|
||||
{
|
||||
result.insert(SearchResult(weight, this, this));
|
||||
addResultsRecursive(result, p.first, p.second);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +107,16 @@ SearchResults SearchNode::runFuzzySearch(const std::string& query, bool recursiv
|
||||
return result;
|
||||
}
|
||||
|
||||
void SearchNode::addResultsRecursive(SearchResults& result, size_t weight, const SearchNode* node) const
|
||||
{
|
||||
result.insert(SearchResult(weight, node, this));
|
||||
|
||||
for (std::shared_ptr<SearchNode> n: node->m_nodes)
|
||||
{
|
||||
addResultsRecursive(result, weight, n.get());
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<SearchNode> SearchNode::addNodeRecursive(
|
||||
std::deque<Id>* nameIds, const Dictionary& dictionary
|
||||
){
|
||||
|
||||
Reference in New Issue
Block a user