src: Fixes for release
* Fixed annotations in code view when showing errors * Fixed context menu hatched for non-indexed/incomplete file button * Fixed file minimize button losing hover style when leaving to file bar * Fixed only change bookmark button state when active node is bookmarked * Fixed use bezier edges when expanding node on aggregation graph * Fixed manually expanded nodes stay expanded
This commit is contained in:
@@ -281,7 +281,11 @@ void BookmarkController::handleMessage(MessageCreateBookmark* message)
|
||||
|
||||
m_bookmarkCache.clear();
|
||||
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::ALREADY_CREATED);
|
||||
if (!message->nodeId || (m_activeNodeIds.size() == 1 && m_activeNodeIds[0] == message->nodeId))
|
||||
{
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::ALREADY_CREATED);
|
||||
}
|
||||
|
||||
getView<BookmarkView>()->update();
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ void CodeController::handleMessage(MessageActivateTokens* message)
|
||||
m_collection = m_storageAccess->getSourceLocationsForTokenIds(params.activeTokenIds);
|
||||
|
||||
std::vector<CodeSnippetParams> snippets = getSnippetsForActiveSourceLocations(m_collection.get(), declarationId);
|
||||
expandVisibleSnippets(&snippets);
|
||||
expandVisibleSnippets(&snippets, true);
|
||||
|
||||
view->showCodeSnippets(snippets, params);
|
||||
|
||||
@@ -314,7 +314,7 @@ void CodeController::handleMessage(MessageShowErrors* message)
|
||||
|
||||
std::sort(snippets.begin(), snippets.end(), CodeSnippetParams::sortById);
|
||||
|
||||
expandVisibleSnippets(&snippets);
|
||||
expandVisibleSnippets(&snippets, false);
|
||||
|
||||
CodeView::CodeParams params;
|
||||
params.clearSnippets = true;
|
||||
@@ -340,7 +340,7 @@ void CodeController::handleMessage(MessageSearchFullText* message)
|
||||
getView()->scrollTo(scrollParams);
|
||||
|
||||
std::vector<CodeSnippetParams> snippets = getSnippetsForCollection(m_collection, true);
|
||||
expandVisibleSnippets(&snippets);
|
||||
expandVisibleSnippets(&snippets, true);
|
||||
|
||||
CodeView::CodeParams params;
|
||||
params.clearSnippets = true;
|
||||
@@ -398,7 +398,7 @@ void CodeController::clear()
|
||||
m_collection.reset();
|
||||
}
|
||||
|
||||
void CodeController::expandVisibleSnippets(std::vector<CodeSnippetParams>* snippets) const
|
||||
void CodeController::expandVisibleSnippets(std::vector<CodeSnippetParams>* snippets, bool addSourceLocations) const
|
||||
{
|
||||
TRACE();
|
||||
|
||||
@@ -417,7 +417,7 @@ void CodeController::expandVisibleSnippets(std::vector<CodeSnippetParams>* snipp
|
||||
}
|
||||
|
||||
std::vector<CodeSnippetParams> newSnippets =
|
||||
getSnippetsForFileWithState(oldSnippet.locationFile->getFilePath(), state, true);
|
||||
getSnippetsForFileWithState(oldSnippet.locationFile->getFilePath(), state, addSourceLocations);
|
||||
if (!newSnippets.size())
|
||||
{
|
||||
continue;
|
||||
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
|
||||
virtual void clear();
|
||||
|
||||
void expandVisibleSnippets(std::vector<CodeSnippetParams>* snippets) const;
|
||||
void expandVisibleSnippets(std::vector<CodeSnippetParams>* snippets, bool addSourceLocations) const;
|
||||
|
||||
std::vector<CodeSnippetParams> getSnippetsForFileWithState(
|
||||
const FilePath& filePath, CodeView::FileState state, bool addSourceLocations) const;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
GraphController::GraphController(StorageAccess* storageAccess)
|
||||
: m_storageAccess(storageAccess)
|
||||
, m_useBezierEdges(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -86,7 +87,7 @@ void GraphController::handleMessage(MessageActivateTokens* message)
|
||||
std::vector<Id> tokenIds = utility::concat(m_activeNodeIds, m_activeEdgeIds);
|
||||
|
||||
bool isNamespace = false;
|
||||
std::shared_ptr<Graph> graph = m_storageAccess->getGraphForActiveTokenIds(tokenIds, &isNamespace);
|
||||
std::shared_ptr<Graph> graph = m_storageAccess->getGraphForActiveTokenIds(tokenIds, getExpandedNodeIds(), &isNamespace);
|
||||
|
||||
createDummyGraphForTokenIdsAndSetActiveAndVisibility(tokenIds, graph);
|
||||
|
||||
@@ -108,6 +109,11 @@ void GraphController::handleMessage(MessageActivateTokens* message)
|
||||
assignBundleIds();
|
||||
}
|
||||
|
||||
if (message->isAggregation)
|
||||
{
|
||||
m_useBezierEdges = true;
|
||||
}
|
||||
|
||||
buildGraph(message, !isNamespace, true, isNamespace);
|
||||
}
|
||||
|
||||
@@ -318,7 +324,7 @@ void GraphController::handleMessage(MessageGraphNodeExpand* message)
|
||||
break;
|
||||
}
|
||||
|
||||
std::shared_ptr<Graph> aggregationGraph = m_storageAccess->getGraphForActiveTokenIds(aggregationIds);
|
||||
std::shared_ptr<Graph> aggregationGraph = m_storageAccess->getGraphForActiveTokenIds(aggregationIds, std::vector<Id>());
|
||||
|
||||
aggregationGraph->forEachEdge(
|
||||
[this](Edge* e)
|
||||
@@ -396,6 +402,8 @@ void GraphController::clear()
|
||||
|
||||
m_graph.reset();
|
||||
|
||||
m_useBezierEdges = false;
|
||||
|
||||
getView()->clear();
|
||||
}
|
||||
|
||||
@@ -474,6 +482,7 @@ void GraphController::createDummyGraphForTokenIds(const std::vector<Id>& tokenId
|
||||
m_dummyNodes = dummyNodes;
|
||||
|
||||
m_graph = graph;
|
||||
m_useBezierEdges = false;
|
||||
}
|
||||
|
||||
void GraphController::createDummyGraphForTokenIdsAndSetActiveAndVisibility(
|
||||
@@ -1555,13 +1564,7 @@ void GraphController::buildGraph(
|
||||
params.animatedTransition = animatedTransition;
|
||||
params.scrollToTop = scrollToTop;
|
||||
params.isIndexedList = scrollToTop;
|
||||
params.bezierEdges = false;
|
||||
|
||||
MessageActivateTokens* msg = dynamic_cast<MessageActivateTokens*>(message);
|
||||
if (msg && msg->isAggregation)
|
||||
{
|
||||
params.bezierEdges = true;
|
||||
}
|
||||
params.bezierEdges = m_useBezierEdges;
|
||||
|
||||
getView()->rebuildGraph(m_graph, m_dummyNodes, m_dummyEdges, params);
|
||||
}
|
||||
|
||||
@@ -131,6 +131,8 @@ private:
|
||||
std::shared_ptr<Graph> m_graph;
|
||||
|
||||
std::map<Id, Id> m_topLevelAncestorIds;
|
||||
|
||||
bool m_useBezierEdges;
|
||||
};
|
||||
|
||||
#endif // GRAPH_CONTROLLER_H
|
||||
|
||||
@@ -987,7 +987,7 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForAll() const
|
||||
}
|
||||
|
||||
std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
|
||||
const std::vector<Id>& tokenIds, bool* isActiveNamespace) const
|
||||
const std::vector<Id>& tokenIds, const std::vector<Id>& expandedNodeIds, bool* isActiveNamespace) const
|
||||
{
|
||||
TRACE();
|
||||
|
||||
@@ -1103,6 +1103,26 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
|
||||
addAggregationEdgesToGraph(tokenIds[0], edgesToAggregate, graph);
|
||||
}
|
||||
|
||||
if (!isNamespace)
|
||||
{
|
||||
std::vector<Id> expandedChildIds;
|
||||
std::vector<Id> expandedChildEdgeIds;
|
||||
|
||||
for (Id nodeId : expandedNodeIds)
|
||||
{
|
||||
if (graph->getNodeById(nodeId))
|
||||
{
|
||||
m_hierarchyCache.addFirstNonImplicitChildIdsForNodeId(nodeId, &expandedChildIds, &expandedChildEdgeIds);
|
||||
}
|
||||
}
|
||||
|
||||
if (expandedChildIds.size())
|
||||
{
|
||||
addNodesToGraph(expandedChildIds, graph);
|
||||
addEdgesToGraph(expandedChildEdgeIds, graph);
|
||||
}
|
||||
}
|
||||
|
||||
addComponentAccessToGraph(graph);
|
||||
|
||||
if (isActiveNamespace)
|
||||
@@ -1778,10 +1798,19 @@ std::vector<Id> PersistentStorage::getAllChildNodeIds(const Id nodeId) const
|
||||
return utility::toVector(childNodeIds);
|
||||
}
|
||||
|
||||
void PersistentStorage::addNodesToGraph(const std::vector<Id>& nodeIds, Graph* graph) const
|
||||
void PersistentStorage::addNodesToGraph(const std::vector<Id>& newNodeIds, Graph* graph) const
|
||||
{
|
||||
TRACE();
|
||||
|
||||
std::vector<Id> nodeIds;
|
||||
for (Id id : newNodeIds)
|
||||
{
|
||||
if (!graph->getNodeById(id))
|
||||
{
|
||||
nodeIds.push_back(id);
|
||||
}
|
||||
}
|
||||
|
||||
if (nodeIds.size() == 0)
|
||||
{
|
||||
return;
|
||||
@@ -1865,10 +1894,19 @@ void PersistentStorage::addNodesToGraph(const std::vector<Id>& nodeIds, Graph* g
|
||||
}
|
||||
}
|
||||
|
||||
void PersistentStorage::addEdgesToGraph(const std::vector<Id>& edgeIds, Graph* graph) const
|
||||
void PersistentStorage::addEdgesToGraph(const std::vector<Id>& newEdgeIds, Graph* graph) const
|
||||
{
|
||||
TRACE();
|
||||
|
||||
std::vector<Id> edgeIds;
|
||||
for (Id id : newEdgeIds)
|
||||
{
|
||||
if (!graph->getEdgeById(id))
|
||||
{
|
||||
edgeIds.push_back(id);
|
||||
}
|
||||
}
|
||||
|
||||
if (edgeIds.size() == 0)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -107,7 +107,8 @@ public:
|
||||
virtual std::vector<SearchMatch> getSearchMatchesForTokenIds(const std::vector<Id>& elementIds) const;
|
||||
|
||||
virtual std::shared_ptr<Graph> getGraphForAll() const;
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds, bool* isActiveNamespace = nullptr) const;
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(
|
||||
const std::vector<Id>& tokenIds, const std::vector<Id>& expandedNodeIds, bool* isActiveNamespace = nullptr) const;
|
||||
virtual std::shared_ptr<Graph> getGraphForChildrenOfNodeId(Id nodeId) const;
|
||||
virtual std::shared_ptr<Graph> getGraphForTrail(Id originId, Id targetId, Edge::EdgeTypeMask trailType, size_t depth) const;
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@ public:
|
||||
virtual std::vector<SearchMatch> getSearchMatchesForTokenIds(const std::vector<Id>& tokenIds) const = 0;
|
||||
|
||||
virtual std::shared_ptr<Graph> getGraphForAll() const = 0;
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds, bool* isActiveNamespace = nullptr) const = 0;
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(
|
||||
const std::vector<Id>& tokenIds, const std::vector<Id>& expandedNodeIds, bool* isActiveNamespace = nullptr) const = 0;
|
||||
virtual std::shared_ptr<Graph> getGraphForChildrenOfNodeId(Id nodeId) const = 0;
|
||||
virtual std::shared_ptr<Graph> getGraphForTrail(Id originId, Id targetId, Edge::EdgeTypeMask trailType, size_t depth) const = 0;
|
||||
|
||||
|
||||
@@ -155,11 +155,12 @@ std::shared_ptr<Graph> StorageAccessProxy::getGraphForAll() const
|
||||
return std::make_shared<Graph>();
|
||||
}
|
||||
|
||||
std::shared_ptr<Graph> StorageAccessProxy::getGraphForActiveTokenIds(const std::vector<Id>& tokenIds, bool* isActiveNamespace) const
|
||||
std::shared_ptr<Graph> StorageAccessProxy::getGraphForActiveTokenIds(
|
||||
const std::vector<Id>& tokenIds, const std::vector<Id>& expandedNodeIds, bool* isActiveNamespace) const
|
||||
{
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getGraphForActiveTokenIds(tokenIds, isActiveNamespace);
|
||||
return m_subject->getGraphForActiveTokenIds(tokenIds, expandedNodeIds, isActiveNamespace);
|
||||
}
|
||||
|
||||
return std::make_shared<Graph>();
|
||||
|
||||
@@ -37,7 +37,8 @@ public:
|
||||
virtual std::vector<SearchMatch> getSearchMatchesForTokenIds(const std::vector<Id>& tokenIds) const;
|
||||
|
||||
virtual std::shared_ptr<Graph> getGraphForAll() const;
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds, bool* isActiveNamespace = nullptr) const;
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(
|
||||
const std::vector<Id>& tokenIds, const std::vector<Id>& expandedNodeIds, bool* isActiveNamespace = nullptr) const;
|
||||
virtual std::shared_ptr<Graph> getGraphForChildrenOfNodeId(Id nodeId) const;
|
||||
virtual std::shared_ptr<Graph> getGraphForTrail(Id originId, Id targetId, Edge::EdgeTypeMask trailType, size_t depth) const;
|
||||
|
||||
|
||||
@@ -473,24 +473,15 @@ void QtCodeFile::enteredTitleBar(QPushButton* button)
|
||||
{
|
||||
if (m_minimizeButton->isEnabled())
|
||||
{
|
||||
if (m_minimizeButton != button)
|
||||
{
|
||||
m_minimizeButton->hoverIn();
|
||||
}
|
||||
m_minimizeButton->hoverIn();
|
||||
}
|
||||
else if (m_snippetButton->isEnabled())
|
||||
{
|
||||
if (m_snippetButton != button)
|
||||
{
|
||||
m_snippetButton->hoverIn();
|
||||
}
|
||||
m_snippetButton->hoverIn();
|
||||
}
|
||||
else if (m_maximizeButton->isEnabled())
|
||||
{
|
||||
if (m_maximizeButton != button)
|
||||
{
|
||||
m_maximizeButton->hoverIn();
|
||||
}
|
||||
m_maximizeButton->hoverIn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ void QtCodeFileTitleButton::setIsComplete(bool isComplete)
|
||||
);
|
||||
|
||||
setStyleSheet((
|
||||
"background-image: url(" + hatchingFilePath.str() + ");"
|
||||
"#title_label { background-image: url(" + hatchingFilePath.str() + "); }"
|
||||
).c_str());
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user