From 333daa05c5e8b3876694fd74cb3964c7894e5918 Mon Sep 17 00:00:00 2001 From: Xavier Michelon Date: Wed, 3 May 2023 15:19:02 +0200 Subject: [PATCH] feat(GODT-2540): pop-up notification error icon is loaded on startup. --- internal/frontend/bridge-gui/bridge-gui/TrayIcon.cpp | 8 ++++---- internal/frontend/bridge-gui/bridge-gui/TrayIcon.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/frontend/bridge-gui/bridge-gui/TrayIcon.cpp b/internal/frontend/bridge-gui/bridge-gui/TrayIcon.cpp index ccb3528b..bf8504ba 100644 --- a/internal/frontend/bridge-gui/bridge-gui/TrayIcon.cpp +++ b/internal/frontend/bridge-gui/bridge-gui/TrayIcon.cpp @@ -159,8 +159,9 @@ QString qmlResourcePathToQt(QString const &path) { //**************************************************************************************************************************************************** TrayIcon::TrayIcon() : QSystemTrayIcon() - , menu_(new QMenu) { - + , menu_(new QMenu) + , notificationErrorIcon_(loadIconFromSVG(":/qml/icons/ic-alert.svg")) + { this->generateDotIcons(); this->setContextMenu(menu_.get()); @@ -304,8 +305,7 @@ void TrayIcon::setState(TrayIcon::State state, QString const &stateString, QStri /// \param[in] message The message. //**************************************************************************************************************************************************** void TrayIcon::showErrorPopupNotification(QString const &title, QString const &message) { -// this->showMessage(title, message, loadIconFromSVG(":/qml/icons/ic-exclamation-circle-filled.svg", errorColor)); - this->showMessage(title, message, loadIconFromSVG(":/qml/icons/ic-alert.svg")); + this->showMessage(title, message, notificationErrorIcon_); } diff --git a/internal/frontend/bridge-gui/bridge-gui/TrayIcon.h b/internal/frontend/bridge-gui/bridge-gui/TrayIcon.h index 326d0d7b..058ca1c2 100644 --- a/internal/frontend/bridge-gui/bridge-gui/TrayIcon.h +++ b/internal/frontend/bridge-gui/bridge-gui/TrayIcon.h @@ -67,6 +67,7 @@ private: // data members QIcon greenDot_; ///< The green dot icon. QIcon greyDot_; ///< The grey dot icon. QIcon orangeDot_; ///< The orange dot icon. + QIcon const notificationErrorIcon_; ///< The error icon used for notifications. QTimer iconRefreshTimer_; ///< The timer used to periodically refresh the icon when DPI changes. QDateTime iconRefreshDeadline_; ///< The deadline for refreshing the icon