ui: draw scope annotations in CodeView using one big rectangle

And refactored QtCodeFile classes.
This commit is contained in:
Eberhard Graether
2015-05-16 12:57:47 +02:00
parent 8e9b7ec7bc
commit e4d71f8a01
9 changed files with 181 additions and 119 deletions
+11 -9
View File
@@ -10,6 +10,7 @@
QtCodeFileList::QtCodeFileList(QWidget* parent)
: QScrollArea(parent)
, m_showMaximizeButton(true)
, m_focusedTokenId(0)
{
m_frame = std::make_shared<QFrame>(this);
@@ -70,6 +71,11 @@ void QtCodeFileList::clearCodeSnippets()
this->verticalScrollBar()->setValue(0);
}
Id QtCodeFileList::getFocusedTokenId() const
{
return m_focusedTokenId;
}
const std::vector<Id>& QtCodeFileList::getActiveTokenIds() const
{
return m_activeTokenIds;
@@ -107,22 +113,18 @@ void QtCodeFileList::updateFiles()
{
for (std::shared_ptr<QtCodeFile> file: m_files)
{
file->update();
file->updateContent();
}
}
void QtCodeFileList::focusToken(Id tokenId)
{
for (std::shared_ptr<QtCodeFile> file: m_files)
{
file->focusToken(tokenId);
}
m_focusedTokenId = tokenId;
updateFiles();
}
void QtCodeFileList::defocusToken()
{
for (std::shared_ptr<QtCodeFile> file: m_files)
{
file->defocusToken();
}
m_focusedTokenId = 0;
updateFiles();
}