ui: scroll to code snippet containing clicked edge

This change scrolls animated to the snippet representing the clicked edge instead of showing only this code snippet.
This commit is contained in:
Eberhard Graether
2015-05-31 22:52:16 +02:00
parent 3e419bb41f
commit 20ce168712
12 changed files with 187 additions and 16 deletions
@@ -52,6 +52,12 @@ void CodeController::handleMessage(MessageActivateTokens* message)
view->setActiveTokenIds(activeTokenIds);
view->setErrorMessages(std::vector<std::string>());
if (message->isEdge)
{
view->scrollToFirstActiveSnippet();
return;
}
TokenLocationCollection collection = m_storageAccess->getTokenLocationsForTokenIds(activeTokenIds);
view->showCodeSnippets(getSnippetsForActiveTokenLocations(collection, declarationId));
+2
View File
@@ -43,6 +43,8 @@ public:
virtual void showCodeSnippets(const std::vector<CodeSnippetParams>& snippets) = 0;
virtual void showCodeFile(const CodeSnippetParams& params) = 0;
virtual void scrollToFirstActiveSnippet() = 0;
virtual void focusToken(const Id tokenId) = 0;
virtual void defocusToken() = 0;