mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-21 16:55:46 +03:00
Handle Qt style names in a case insensitive way
PR #21720. Closes #21716.
This commit is contained in:
parent
6f642776b6
commit
b083029841
1 changed files with 2 additions and 3 deletions
|
@ -1710,11 +1710,10 @@ void OptionsDialog::initializeStyleCombo()
|
||||||
QStringList styleNames = QStyleFactory::keys();
|
QStringList styleNames = QStyleFactory::keys();
|
||||||
std::sort(styleNames.begin(), styleNames.end(), Utils::Compare::NaturalLessThan<Qt::CaseInsensitive>());
|
std::sort(styleNames.begin(), styleNames.end(), Utils::Compare::NaturalLessThan<Qt::CaseInsensitive>());
|
||||||
m_ui->comboStyle->addItems(styleNames);
|
m_ui->comboStyle->addItems(styleNames);
|
||||||
|
|
||||||
const QString prefStyleName = Preferences::instance()->getStyle();
|
const QString prefStyleName = Preferences::instance()->getStyle();
|
||||||
const QString selectedStyleName = prefStyleName.isEmpty() ? QApplication::style()->name() : prefStyleName;
|
const QString selectedStyleName = prefStyleName.isEmpty() ? QApplication::style()->name() : prefStyleName;
|
||||||
|
m_ui->comboStyle->setCurrentIndex(m_ui->comboStyle->findText(selectedStyleName, Qt::MatchFixedString));
|
||||||
if (selectedStyleName.compare(u"system"_s, Qt::CaseInsensitive) != 0)
|
|
||||||
m_ui->comboStyle->setCurrentText(selectedStyleName);
|
|
||||||
#else
|
#else
|
||||||
m_ui->labelStyle->hide();
|
m_ui->labelStyle->hide();
|
||||||
m_ui->comboStyle->hide();
|
m_ui->comboStyle->hide();
|
||||||
|
|
Loading…
Reference in a new issue