mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Attempt to use qBittorrent icon from theme if available (closes #49)
This commit is contained in:
parent
10f147ff40
commit
879f8f080d
@ -105,7 +105,13 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
|
|||||||
// Clean exit on log out
|
// Clean exit on log out
|
||||||
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
|
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
|
||||||
// Setting icons
|
// Setting icons
|
||||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
#if defined(Q_WS_X11)
|
||||||
|
if (Preferences().useSystemIconTheme())
|
||||||
|
setWindowIcon(QIcon::fromTheme("qbittorrent", QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
||||||
|
else
|
||||||
|
#else
|
||||||
|
setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
||||||
|
#endif
|
||||||
actionOpen->setIcon(IconProvider::instance()->getIcon("list-add"));
|
actionOpen->setIcon(IconProvider::instance()->getIcon("list-add"));
|
||||||
actionDownload_from_URL->setIcon(IconProvider::instance()->getIcon("insert-link"));
|
actionDownload_from_URL->setIcon(IconProvider::instance()->getIcon("insert-link"));
|
||||||
actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
|
actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
|
||||||
@ -1399,8 +1405,15 @@ QIcon MainWindow::getSystrayIcon() const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
|
#if defined(Q_WS_X11)
|
||||||
|
if (Preferences().useSystemIconTheme()) {
|
||||||
|
icon = QIcon::fromTheme("qbittorrent");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (icon.isNull()) {
|
||||||
icon.addFile(":/Icons/skin/qbittorrent22.png", QSize(22, 22));
|
icon.addFile(":/Icons/skin/qbittorrent22.png", QSize(22, 22));
|
||||||
icon.addFile(":/Icons/skin/qbittorrent16.png", QSize(16, 16));
|
icon.addFile(":/Icons/skin/qbittorrent16.png", QSize(16, 16));
|
||||||
icon.addFile(":/Icons/skin/qbittorrent32.png", QSize(32, 32));
|
icon.addFile(":/Icons/skin/qbittorrent32.png", QSize(32, 32));
|
||||||
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user