Merge pull request #929 from aeghn/read_tray_icons_from_theme

Enhancement: Read theme's panel icons.
This commit is contained in:
Povilas Kanapickas 2020-11-22 17:30:01 +02:00 committed by GitHub
commit 142e8dc847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -80,6 +80,14 @@ static const char* barrierIconFiles[] =
#endif
};
static const char* barrierIconNames[] =
{
"barrier-disconnected",
"barrier-disconnected",
"barrier-connected",
"barrier-transfering"
};
static const char* barrierLargeIcon = ":/res/icons/256x256/barrier.ico";
MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
@ -296,7 +304,7 @@ void MainWindow::saveSettings()
void MainWindow::setIcon(qBarrierState state)
{
if (m_pTrayIcon) {
QIcon icon = QIcon(barrierIconFiles[state]);
QIcon icon = QIcon::fromTheme(barrierIconNames[state], QIcon(barrierIconFiles[state]));
#if defined(Q_OS_MAC)
icon.setIsMask(true);
#endif