mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Enable to choose dark/light tray icons on all platforms.
This commit is contained in:
parent
24c2f73a9d
commit
30f21259f8
2 changed files with 14 additions and 18 deletions
|
@ -1588,6 +1588,10 @@ void MainWindow::checkForActiveTorrents()
|
||||||
QIcon MainWindow::getSystrayIcon() const
|
QIcon MainWindow::getSystrayIcon() const
|
||||||
{
|
{
|
||||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
||||||
|
if (Preferences::instance()->useSystemIconTheme())
|
||||||
|
return QIcon::fromTheme("qbittorrent");
|
||||||
|
#endif
|
||||||
|
|
||||||
TrayIcon::Style style = Preferences::instance()->trayIconStyle();
|
TrayIcon::Style style = Preferences::instance()->trayIconStyle();
|
||||||
switch(style) {
|
switch(style) {
|
||||||
case TrayIcon::MONO_DARK:
|
case TrayIcon::MONO_DARK:
|
||||||
|
@ -1597,18 +1601,11 @@ QIcon MainWindow::getSystrayIcon() const
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
QIcon icon;
|
|
||||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
|
||||||
if (Preferences::instance()->useSystemIconTheme())
|
|
||||||
icon = QIcon::fromTheme("qbittorrent");
|
|
||||||
|
|
||||||
#endif
|
QIcon icon;
|
||||||
if (icon.isNull()) {
|
icon.addFile(":/icons/skin/qbittorrent16.png");
|
||||||
icon.addFile(":/icons/skin/qbittorrent22.png", QSize(22, 22));
|
icon.addFile(":/icons/skin/qbittorrent22.png");
|
||||||
icon.addFile(":/icons/skin/qbittorrent16.png", QSize(16, 16));
|
icon.addFile(":/icons/skin/qbittorrent32.png");
|
||||||
icon.addFile(":/icons/skin/qbittorrent32.png", QSize(32, 32));
|
|
||||||
}
|
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,11 +113,10 @@ options_imp::options_imp(QWidget *parent):
|
||||||
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
|
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||||
checkShowSystray->setChecked(false);
|
checkShowSystray->setChecked(false);
|
||||||
checkShowSystray->setEnabled(false);
|
checkShowSystray->setEnabled(false);
|
||||||
}
|
|
||||||
#if (!defined(Q_OS_UNIX) || defined(Q_OS_MAC))
|
|
||||||
label_trayIconStyle->setVisible(false);
|
label_trayIconStyle->setVisible(false);
|
||||||
comboTrayIcon->setVisible(false);
|
comboTrayIcon->setVisible(false);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#if defined(QT_NO_OPENSSL)
|
#if defined(QT_NO_OPENSSL)
|
||||||
checkWebUiHttps->setVisible(false);
|
checkWebUiHttps->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue