Browse Source

Attempt to use qBittorrent icon from theme if available (closes #49)

adaptive-webui-19844
Christophe Dumez 12 years ago
parent
commit
879f8f080d
  1. 21
      src/mainwindow.cpp

21
src/mainwindow.cpp

@ -105,7 +105,13 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa @@ -105,7 +105,13 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
// Clean exit on log out
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
// 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"));
actionDownload_from_URL->setIcon(IconProvider::instance()->getIcon("insert-link"));
actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
@ -1399,8 +1405,15 @@ QIcon MainWindow::getSystrayIcon() const @@ -1399,8 +1405,15 @@ QIcon MainWindow::getSystrayIcon() const
}
#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));
#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/qbittorrent16.png", QSize(16, 16));
icon.addFile(":/Icons/skin/qbittorrent32.png", QSize(32, 32));
}
return icon;
}

Loading…
Cancel
Save