Axivion: Add highlight marks to toolbar

Make it more easy to toggle between showing inline
markers or not.
This also makes the reaction more direct. Before this
change markers were kept or not added until the file
got re-opened the next time.

Change-Id: I3ad56444648967db9565176e5b60ac6df8c32ff1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Christian Stenger
2024-08-01 12:51:33 +02:00
parent 1b23330ec3
commit 2a4c8af193
2 changed files with 21 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
#include "axivionoutputpane.h"
#include "axivionplugin.h"
#include "axivionsettings.h"
#include "axiviontr.h"
#include "dashboard/dto.h"
#include "issueheaderview.h"
@@ -813,6 +814,18 @@ public:
m_showDashboard->setChecked(idx == 0);
m_showIssues->setChecked(idx == 1);
});
m_toggleIssues = new QToolButton(m_outputWidget);
m_toggleIssues->setIcon(Utils::Icons::WARNING_TOOLBAR.icon());
m_toggleIssues->setToolTip(Tr::tr("Show issue markers inline"));
m_toggleIssues->setCheckable(true);
m_toggleIssues->setChecked(settings().highlightMarks());
connect(m_toggleIssues, &QToolButton::toggled, this, [](bool checked) {
settings().highlightMarks.setValue(checked);
});
connect(&settings().highlightMarks, &BaseAspect::changed, this, [this] {
m_toggleIssues->setChecked(settings().highlightMarks());
});
}
~AxivionOutputPane()
@@ -832,7 +845,7 @@ public:
QList<QWidget *> toolBarWidgets() const final
{
return {m_showDashboard, m_showIssues};
return {m_showDashboard, m_showIssues, m_toggleIssues};
}
void clearContents() final {}
@@ -909,6 +922,7 @@ private:
QStackedWidget *m_outputWidget = nullptr;
QToolButton *m_showDashboard = nullptr;
QToolButton *m_showIssues = nullptr;
QToolButton *m_toggleIssues = nullptr;
};

View File

@@ -309,6 +309,12 @@ AxivionPluginPrivate::AxivionPluginPrivate()
connect(&m_networkAccessManager, &QNetworkAccessManager::sslErrors,
this, &AxivionPluginPrivate::handleSslErrors);
#endif // ssl
connect(&settings().highlightMarks, &BoolAspect::changed, this, [this] {
if (settings().highlightMarks())
handleOpenedDocs();
else
clearAllMarks();
});
}
void AxivionPluginPrivate::handleSslErrors(QNetworkReply *reply, const QList<QSslError> &errors)