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:
@@ -146,10 +146,9 @@ void QtCodeView::showCodeSnippets(const std::vector<CodeSnippetParams>& snippets
|
||||
m_widget->addedFiles();
|
||||
}
|
||||
|
||||
m_widget->updateFiles();
|
||||
|
||||
if (params.showContents)
|
||||
{
|
||||
m_widget->updateFiles();
|
||||
m_widget->showContents();
|
||||
performScroll();
|
||||
}
|
||||
@@ -231,6 +230,7 @@ void QtCodeView::showContents()
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
TRACE("show contents");
|
||||
m_widget->updateFiles();
|
||||
m_widget->showContents();
|
||||
performScroll();
|
||||
});
|
||||
@@ -241,6 +241,19 @@ bool QtCodeView::isInListMode() const
|
||||
return m_widget->isInListMode();
|
||||
}
|
||||
|
||||
void QtCodeView::setMode(bool listMode)
|
||||
{
|
||||
if (isInListMode() == listMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_widget->setMode(listMode ? QtCodeNavigator::MODE_LIST : QtCodeNavigator::MODE_SINGLE);
|
||||
});
|
||||
}
|
||||
|
||||
bool QtCodeView::hasSingleFileCached(const FilePath& filePath) const
|
||||
{
|
||||
return m_widget->hasSingleFileCached(filePath);
|
||||
|
||||
Reference in New Issue
Block a user