ui: focusing multiple tokens at once

This change focuses all token locations underneath the cursor at once by extending the focus handling to use vectors.
This commit is contained in:
Eberhard Graether
2015-11-12 10:14:46 +01:00
parent 28e3880e10
commit 00b74d2f30
18 changed files with 181 additions and 157 deletions
+14 -10
View File
@@ -12,7 +12,6 @@
QtCodeFileList::QtCodeFileList(QWidget* parent)
: QScrollArea(parent)
, m_focusedTokenId(0)
{
setObjectName("code_file_list_base");
@@ -77,11 +76,6 @@ void QtCodeFileList::clearCodeSnippets()
this->verticalScrollBar()->setValue(0);
}
Id QtCodeFileList::getFocusedTokenId() const
{
return m_focusedTokenId;
}
const std::vector<Id>& QtCodeFileList::getActiveTokenIds() const
{
return m_activeTokenIds;
@@ -92,6 +86,16 @@ void QtCodeFileList::setActiveTokenIds(const std::vector<Id>& activeTokenIds)
m_activeTokenIds = activeTokenIds;
}
const std::vector<Id>& QtCodeFileList::getFocusedTokenIds() const
{
return m_focusedTokenIds;
}
void QtCodeFileList::setFocusedTokenIds(const std::vector<Id>& focusedTokenIds)
{
m_focusedTokenIds = focusedTokenIds;
}
const std::vector<std::string>& QtCodeFileList::getErrorMessages() const
{
return m_errorMessages;
@@ -136,15 +140,15 @@ void QtCodeFileList::expandActiveSnippetFile()
}
}
void QtCodeFileList::focusToken(Id tokenId)
void QtCodeFileList::focusTokenIds(const std::vector<Id>& focusedTokenIds)
{
m_focusedTokenId = tokenId;
setFocusedTokenIds(focusedTokenIds);
updateFiles();
}
void QtCodeFileList::defocusToken()
void QtCodeFileList::defocusTokenIds()
{
m_focusedTokenId = 0;
setFocusedTokenIds(std::vector<Id>());
updateFiles();
}