ui: switch to single file mode with snippet maximize
* switch back to snippet view with snippet button in file title bar * use new title bar widget in single view as well * restore view mode on undo, store current view mode for every message id (added id to message) * treat view mode switch as adapt message on undo stack * fixed crash after snippet expansion * fixed hatching in file title not shown
This commit is contained in:
@@ -72,6 +72,11 @@ void QtCodeFileList::clear()
|
||||
m_files.clear();
|
||||
m_scrollArea->verticalScrollBar()->setValue(0);
|
||||
|
||||
clearSnippetTitleAndScrollBar();
|
||||
}
|
||||
|
||||
void QtCodeFileList::clearSnippetTitleAndScrollBar()
|
||||
{
|
||||
updateFirstSnippetTitleBar(nullptr);
|
||||
updateLastSnippetScrollBar(nullptr);
|
||||
}
|
||||
@@ -221,6 +226,7 @@ void QtCodeFileList::showContents()
|
||||
{
|
||||
for (QtCodeFile* file : m_files)
|
||||
{
|
||||
file->updateTitleBar();
|
||||
file->show();
|
||||
}
|
||||
}
|
||||
@@ -248,17 +254,55 @@ void QtCodeFileList::findScreenMatches(const std::string& query, std::vector<std
|
||||
|
||||
void QtCodeFileList::setFileMinimized(const FilePath path)
|
||||
{
|
||||
getFile(path)->setMinimized();
|
||||
if (path.empty())
|
||||
{
|
||||
if (m_files.size())
|
||||
{
|
||||
m_files[0]->setMinimized();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
getFile(path)->setMinimized();
|
||||
}
|
||||
}
|
||||
|
||||
void QtCodeFileList::setFileSnippets(const FilePath path)
|
||||
{
|
||||
getFile(path)->setSnippets();
|
||||
if (path.empty())
|
||||
{
|
||||
if (m_files.size())
|
||||
{
|
||||
m_files[0]->setSnippets();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
getFile(path)->setSnippets();
|
||||
}
|
||||
}
|
||||
|
||||
void QtCodeFileList::setFileMaximized(const FilePath path)
|
||||
{
|
||||
getFile(path)->setMaximized();
|
||||
if (path.empty())
|
||||
{
|
||||
if (m_files.size())
|
||||
{
|
||||
m_files[0]->setMaximized();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
getFile(path)->setMaximized();
|
||||
}
|
||||
}
|
||||
|
||||
void QtCodeFileList::maximizeFirstFile()
|
||||
{
|
||||
if (m_files.size())
|
||||
{
|
||||
m_files[0]->clickedMaximizeButton();
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<QtCodeSnippet*, Id> QtCodeFileList::getFirstSnippetWithActiveLocationId(Id tokenId) const
|
||||
@@ -284,9 +328,7 @@ std::pair<QtCodeSnippet*, Id> QtCodeFileList::getFirstSnippetWithActiveLocationI
|
||||
|
||||
void QtCodeFileList::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
updateFirstSnippetTitleBar(nullptr);
|
||||
updateLastSnippetScrollBar(nullptr);
|
||||
|
||||
clearSnippetTitleAndScrollBar();
|
||||
updateSnippetTitleAndScrollBar();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user