mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
COSMETIC: Added monochrome tray icon
This commit is contained in:
parent
2acf90d813
commit
14341f3be2
44 changed files with 2904 additions and 2677 deletions
|
@ -1198,11 +1198,7 @@ QMenu* MainWindow::getTrayIconMenu() {
|
|||
|
||||
void MainWindow::createTrayIcon() {
|
||||
// Tray icon
|
||||
#ifdef Q_WS_WIN
|
||||
systrayIcon = new QSystemTrayIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent16.png")), this);
|
||||
#else
|
||||
systrayIcon = new QSystemTrayIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent22.png")), this);
|
||||
#endif
|
||||
systrayIcon = new QSystemTrayIcon(getSystrayIcon(), this);
|
||||
|
||||
systrayIcon->setContextMenu(getTrayIconMenu());
|
||||
connect(systrayIcon, SIGNAL(messageClicked()), this, SLOT(balloonClicked()));
|
||||
|
@ -1345,3 +1341,17 @@ void MainWindow::checkForActiveTorrents()
|
|||
else
|
||||
m_pwr->setActivityState(false);
|
||||
}
|
||||
|
||||
QIcon MainWindow::getSystrayIcon() const
|
||||
{
|
||||
#if defined(Q_WS_X11) && defined(QT_SVG_LIB)
|
||||
if(Preferences().useMonochromeTrayIcon()) {
|
||||
return QIcon(":/Icons/skin/qbittorrent_mono.svg");
|
||||
}
|
||||
#endif
|
||||
QIcon icon;
|
||||
icon.addFile(":/Icons/skin/qbittorrent22.png", QSize(22, 22));
|
||||
icon.addFile(":/Icons/skin/qbittorrent16.png", QSize(16, 16));
|
||||
icon.addFile(":/Icons/skin/qbittorrent32.png", QSize(32, 32));
|
||||
return icon;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue