src: applied clang-format
This commit is contained in:
@@ -4,15 +4,14 @@
|
||||
#include "ResourcePaths.h"
|
||||
#include "tracing.h"
|
||||
|
||||
#include "ColorScheme.h"
|
||||
#include "QtCodeArea.h"
|
||||
#include "QtCodeNavigator.h"
|
||||
#include "QtHighlighter.h"
|
||||
#include "utilityQt.h"
|
||||
#include "QtViewWidgetWrapper.h"
|
||||
#include "ColorScheme.h"
|
||||
#include "utilityQt.h"
|
||||
|
||||
QtCodeView::QtCodeView(ViewLayout* viewLayout)
|
||||
: CodeView(viewLayout)
|
||||
QtCodeView::QtCodeView(ViewLayout* viewLayout): CodeView(viewLayout)
|
||||
{
|
||||
m_widget = new QtCodeNavigator();
|
||||
}
|
||||
@@ -29,8 +28,7 @@ void QtCodeView::refreshView()
|
||||
m_widget->setSchedulerId(getController()->getTabId());
|
||||
}
|
||||
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_onQtThread([=]() {
|
||||
TRACE("refresh");
|
||||
|
||||
setStyleSheet();
|
||||
@@ -49,33 +47,20 @@ bool QtCodeView::isVisible() const
|
||||
|
||||
void QtCodeView::findMatches(ScreenSearchSender* sender, const std::wstring& query)
|
||||
{
|
||||
m_onQtThread(
|
||||
[sender, query, this]()
|
||||
{
|
||||
size_t matchCount = m_widget->findScreenMatches(query);
|
||||
sender->foundMatches(this, matchCount);
|
||||
}
|
||||
);
|
||||
m_onQtThread([sender, query, this]() {
|
||||
size_t matchCount = m_widget->findScreenMatches(query);
|
||||
sender->foundMatches(this, matchCount);
|
||||
});
|
||||
}
|
||||
|
||||
void QtCodeView::activateMatch(size_t matchIndex)
|
||||
{
|
||||
m_onQtThread(
|
||||
[matchIndex, this]()
|
||||
{
|
||||
m_widget->activateScreenMatch(matchIndex);
|
||||
}
|
||||
);
|
||||
m_onQtThread([matchIndex, this]() { m_widget->activateScreenMatch(matchIndex); });
|
||||
}
|
||||
|
||||
void QtCodeView::deactivateMatch(size_t matchIndex)
|
||||
{
|
||||
m_onQtThread(
|
||||
[matchIndex, this]()
|
||||
{
|
||||
m_widget->deactivateScreenMatch(matchIndex);
|
||||
}
|
||||
);
|
||||
m_onQtThread([matchIndex, this]() { m_widget->deactivateScreenMatch(matchIndex); });
|
||||
}
|
||||
|
||||
void QtCodeView::clearMatches()
|
||||
@@ -85,20 +70,12 @@ void QtCodeView::clearMatches()
|
||||
return;
|
||||
}
|
||||
|
||||
m_onQtThread(
|
||||
[this]()
|
||||
{
|
||||
m_widget->clearScreenMatches();
|
||||
}
|
||||
);
|
||||
m_onQtThread([this]() { m_widget->clearScreenMatches(); });
|
||||
}
|
||||
|
||||
void QtCodeView::clear()
|
||||
{
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_widget->clear();
|
||||
});
|
||||
m_onQtThread([=]() { m_widget->clear(); });
|
||||
}
|
||||
|
||||
bool QtCodeView::showsErrors() const
|
||||
@@ -107,10 +84,11 @@ bool QtCodeView::showsErrors() const
|
||||
}
|
||||
|
||||
void QtCodeView::showSnippets(
|
||||
const std::vector<CodeFileParams> files, const CodeParams params, const CodeScrollParams scrollParams)
|
||||
const std::vector<CodeFileParams> files,
|
||||
const CodeParams params,
|
||||
const CodeScrollParams scrollParams)
|
||||
{
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_onQtThread([=]() {
|
||||
TRACE("show snippets");
|
||||
|
||||
m_widget->setMode(QtCodeNavigator::MODE_LIST);
|
||||
@@ -122,7 +100,7 @@ void QtCodeView::showSnippets(
|
||||
|
||||
setNavigationState(params);
|
||||
|
||||
for (const CodeFileParams& file : files)
|
||||
for (const CodeFileParams& file: files)
|
||||
{
|
||||
m_widget->addSnippetFile(file);
|
||||
}
|
||||
@@ -136,8 +114,7 @@ void QtCodeView::showSnippets(
|
||||
void QtCodeView::showSingleFile(
|
||||
const CodeFileParams file, const CodeParams params, const CodeScrollParams scrollParams)
|
||||
{
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_onQtThread([=]() {
|
||||
TRACE("show single file");
|
||||
|
||||
bool animatedScroll = !m_widget->isInListMode();
|
||||
@@ -170,13 +147,12 @@ void QtCodeView::showSingleFile(
|
||||
|
||||
void QtCodeView::updateSourceLocations(const std::vector<CodeFileParams> files)
|
||||
{
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_onQtThread([=]() {
|
||||
TRACE("update source locations");
|
||||
|
||||
for (const CodeFileParams& file : files)
|
||||
for (const CodeFileParams& file: files)
|
||||
{
|
||||
for (const CodeSnippetParams& snippet : file.snippetParams)
|
||||
for (const CodeSnippetParams& snippet: file.snippetParams)
|
||||
{
|
||||
if (snippet.hasAllSourceLocations)
|
||||
{
|
||||
@@ -194,26 +170,17 @@ void QtCodeView::updateSourceLocations(const std::vector<CodeFileParams> files)
|
||||
|
||||
void QtCodeView::scrollTo(const CodeScrollParams params, bool animated)
|
||||
{
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_widget->scrollTo(params, animated);
|
||||
});
|
||||
m_onQtThread([=]() { m_widget->scrollTo(params, animated); });
|
||||
}
|
||||
|
||||
void QtCodeView::focusTokenIds(const std::vector<Id>& focusedTokenIds)
|
||||
{
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_widget->focusTokenIds(focusedTokenIds);
|
||||
});
|
||||
m_onQtThread([=]() { m_widget->focusTokenIds(focusedTokenIds); });
|
||||
}
|
||||
|
||||
void QtCodeView::defocusTokenIds()
|
||||
{
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_widget->defocusTokenIds();
|
||||
});
|
||||
m_onQtThread([=]() { m_widget->defocusTokenIds(); });
|
||||
}
|
||||
|
||||
bool QtCodeView::isInListMode() const
|
||||
@@ -246,7 +213,8 @@ void QtCodeView::setNavigationState(const CodeParams& params)
|
||||
if (params.activeLocalSymbolType == LOCATION_TOKEN)
|
||||
{
|
||||
m_widget->setCurrentActiveTokenIds(
|
||||
params.currentActiveLocalLocationIds.size() ? std::vector<Id>() : params.activeLocalSymbolIds);
|
||||
params.currentActiveLocalLocationIds.size() ? std::vector<Id>()
|
||||
: params.activeLocalSymbolIds);
|
||||
}
|
||||
|
||||
m_widget->setActiveLocalTokenIds(params.activeLocalSymbolIds, params.activeLocalSymbolType);
|
||||
@@ -258,14 +226,19 @@ void QtCodeView::setNavigationState(const CodeParams& params)
|
||||
}
|
||||
|
||||
m_widget->updateReferenceCount(
|
||||
params.referenceCount, params.referenceIndex, params.localReferenceCount, params.localReferenceIndex);
|
||||
params.referenceCount,
|
||||
params.referenceIndex,
|
||||
params.localReferenceCount,
|
||||
params.localReferenceIndex);
|
||||
}
|
||||
|
||||
void QtCodeView::setStyleSheet() const
|
||||
{
|
||||
utility::setWidgetBackgroundColor(m_widget, ColorScheme::getInstance()->getColor("code/background"));
|
||||
utility::setWidgetBackgroundColor(
|
||||
m_widget, ColorScheme::getInstance()->getColor("code/background"));
|
||||
|
||||
std::string styleSheet = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"code_view/code_view.css"));
|
||||
std::string styleSheet = utility::getStyleSheet(
|
||||
ResourcePaths::getGuiPath().concatenate(L"code_view/code_view.css"));
|
||||
|
||||
m_widget->setStyleSheet(styleSheet.c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user