From 1145c744404b9060451f76947aa12d5a17bc1c06 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Thu, 16 Feb 2023 21:28:58 +0100 Subject: [PATCH] - resolved regression: no icon on menutray. --- RsyncUI.pro.user | 2 +- mainwindow.cpp | 6 +++--- mainwindow.h | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/RsyncUI.pro.user b/RsyncUI.pro.user index 4ba88eb..798c730 100644 --- a/RsyncUI.pro.user +++ b/RsyncUI.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/mainwindow.cpp b/mainwindow.cpp index 0e7c371..98257c9 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -100,8 +100,6 @@ MainWindow::MainWindow(QWidget *parent) config.UnitCombobox->addItems({tr("KB"), tr("MB"), tr("GB"), tr("TB"), tr("PB")}); initSystemTrayIcon(); - - } void MainWindow::init() @@ -137,9 +135,11 @@ void MainWindow::initSystemTrayIcon() { QMenu *trayIconMenu; QAction * quitAction; + QIcon icon; + icon.addFile(this->icon); this->trayIcon = new QSystemTrayIcon; - this->trayIcon->setIcon(this->windowIcon()); + this->trayIcon->setIcon(icon); quitAction = new QAction(tr("&Quit"), this); connect(quitAction, &QAction::triggered, this, &MainWindow::quitApp); diff --git a/mainwindow.h b/mainwindow.h index e856786..b447ade 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -105,6 +105,7 @@ class MainWindow : public QMainWindow Ui::windowAbout AboutW; std::vector serversList; QSystemTrayIcon * trayIcon; + QString icon = "/usr/share/icons/RsyncUI.png"; QList bwUnitText { "KB", "MB",