mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00: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
|
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:
|
||||||
@ -1598,18 +1602,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);
|
||||||
|
label_trayIconStyle->setVisible(false);
|
||||||
|
comboTrayIcon->setVisible(false);
|
||||||
}
|
}
|
||||||
#if (!defined(Q_OS_UNIX) || defined(Q_OS_MAC))
|
|
||||||
label_trayIconStyle->setVisible(false);
|
|
||||||
comboTrayIcon->setVisible(false);
|
|
||||||
#endif
|
|
||||||
#if defined(QT_NO_OPENSSL)
|
#if defined(QT_NO_OPENSSL)
|
||||||
checkWebUiHttps->setVisible(false);
|
checkWebUiHttps->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
@ -270,7 +269,7 @@ options_imp::options_imp(QWidget *parent):
|
|||||||
|
|
||||||
// Adapt size
|
// Adapt size
|
||||||
show();
|
show();
|
||||||
loadWindowState();
|
loadWindowState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void options_imp::initializeLanguageCombo()
|
void options_imp::initializeLanguageCombo()
|
||||||
@ -281,7 +280,7 @@ void options_imp::initializeLanguageCombo()
|
|||||||
foreach (QString lang_file, lang_files) {
|
foreach (QString lang_file, lang_files) {
|
||||||
QString localeStr = lang_file.mid(12); // remove "qbittorrent_"
|
QString localeStr = lang_file.mid(12); // remove "qbittorrent_"
|
||||||
localeStr.chop(3); // Remove ".qm"
|
localeStr.chop(3); // Remove ".qm"
|
||||||
QLocale locale(localeStr);
|
QLocale locale(localeStr);
|
||||||
QString language_name = languageToLocalizedString(locale);
|
QString language_name = languageToLocalizedString(locale);
|
||||||
comboI18n->addItem(/*QIcon(":/icons/flags/"+country+".png"), */language_name, localeStr);
|
comboI18n->addItem(/*QIcon(":/icons/flags/"+country+".png"), */language_name, localeStr);
|
||||||
qDebug() << "Supported locale:" << localeStr;
|
qDebug() << "Supported locale:" << localeStr;
|
||||||
@ -790,7 +789,7 @@ void options_imp::loadOptions() {
|
|||||||
domainNameTxt->setText(pref->getDynDomainName());
|
domainNameTxt->setText(pref->getDynDomainName());
|
||||||
DNSUsernameTxt->setText(pref->getDynDNSUsername());
|
DNSUsernameTxt->setText(pref->getDynDNSUsername());
|
||||||
DNSPasswordTxt->setText(pref->getDynDNSPassword());
|
DNSPasswordTxt->setText(pref->getDynDNSPassword());
|
||||||
// End Web UI
|
// End Web UI
|
||||||
}
|
}
|
||||||
|
|
||||||
// return min & max ports
|
// return min & max ports
|
||||||
|
Loading…
Reference in New Issue
Block a user