mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-24 18:44:52 +08:00
Merge pull request #2996 from Chocobo1/tray_icon
Enable to choose dark/light tray icons on all platforms.
This commit is contained in:
commit
46e2e5342b
@ -1589,6 +1589,10 @@ void MainWindow::checkForActiveTorrents()
|
||||
QIcon MainWindow::getSystrayIcon() const
|
||||
{
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
||||
if (Preferences::instance()->useSystemIconTheme())
|
||||
return QIcon::fromTheme("qbittorrent");
|
||||
#endif
|
||||
|
||||
TrayIcon::Style style = Preferences::instance()->trayIconStyle();
|
||||
switch(style) {
|
||||
case TrayIcon::MONO_DARK:
|
||||
@ -1598,18 +1602,11 @@ QIcon MainWindow::getSystrayIcon() const
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
QIcon icon;
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
||||
if (Preferences::instance()->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));
|
||||
}
|
||||
QIcon icon;
|
||||
icon.addFile(":/icons/skin/qbittorrent16.png");
|
||||
icon.addFile(":/icons/skin/qbittorrent22.png");
|
||||
icon.addFile(":/icons/skin/qbittorrent32.png");
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
@ -113,11 +113,10 @@ options_imp::options_imp(QWidget *parent):
|
||||
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||
checkShowSystray->setChecked(false);
|
||||
checkShowSystray->setEnabled(false);
|
||||
}
|
||||
#if (!defined(Q_OS_UNIX) || defined(Q_OS_MAC))
|
||||
label_trayIconStyle->setVisible(false);
|
||||
comboTrayIcon->setVisible(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(QT_NO_OPENSSL)
|
||||
checkWebUiHttps->setVisible(false);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user