fix mainwindow icon

This commit is contained in:
walker0643 2018-04-01 14:00:52 -04:00
parent ecfa7d7d1c
commit 6c4199b11a
1 changed files with 4 additions and 7 deletions

View File

@ -72,6 +72,8 @@ static const char* barrierIconFiles[] =
":/res/icons/16x16/barrier-transfering.png"
};
static const char* barrierLargeIcon = ":/res/icons/256x256/barrier.ico";
MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
m_Settings(settings),
m_AppConfig(&appConfig),
@ -104,7 +106,7 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
setAttribute(Qt::WA_X11NetWmWindowTypeDialog, true);
setupUi(this);
setWindowIcon(QIcon(barrierLargeIcon));
createMenuBar();
loadSettings();
initConnections();
@ -285,13 +287,8 @@ void MainWindow::saveSettings()
void MainWindow::setIcon(qBarrierState state)
{
QIcon icon;
icon.addFile(barrierIconFiles[state]);
setWindowIcon(icon);
if (m_pTrayIcon)
m_pTrayIcon->setIcon(icon);
m_pTrayIcon->setIcon(QIcon(barrierIconFiles[state]));
}
void MainWindow::trayActivated(QSystemTrayIcon::ActivationReason reason)