ui: improved ui of maximized code file window

* Annotations updated when active token Id changes
* FileName in window title
* Maximize button not shown
* Scrolls roughly to the maximized location.
* Maximizing also on double click in code snippet
This commit is contained in:
Eberhard Graether
2014-07-28 01:17:01 +02:00
parent dea79f701b
commit 95929db6e0
11 changed files with 245 additions and 115 deletions
+16
View File
@@ -8,6 +8,7 @@
QtCodeFileList::QtCodeFileList(QWidget* parent)
: QScrollArea(parent)
, m_showMaximizeButton(true)
{
m_frame = std::make_shared<QFrame>(this);
@@ -52,6 +53,8 @@ void QtCodeFileList::addCodeSnippet(
file = filePtr.get();
m_frame->layout()->addWidget(file);
file->setShowMaximizeButton(m_showMaximizeButton);
}
file->addCodeSnippet(startLineNumber, code, locationFile, activeTokenIds);
@@ -61,3 +64,16 @@ void QtCodeFileList::clearCodeSnippets()
{
m_files.clear();
}
void QtCodeFileList::setActiveTokenIds(const std::vector<Id>& activeTokenIds)
{
for (std::shared_ptr<QtCodeFile> file: m_files)
{
file->setActiveTokenIds(activeTokenIds);
}
}
void QtCodeFileList::setShowMaximizeButton(bool show)
{
m_showMaximizeButton = show;
}