mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 10:16:00 +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();
|
||||
std::sort(styleNames.begin(), styleNames.end(), Utils::Compare::NaturalLessThan<Qt::CaseInsensitive>());
|
||||
m_ui->comboStyle->addItems(styleNames);
|
||||
|
||||
const QString prefStyleName = Preferences::instance()->getStyle();
|
||||
const QString selectedStyleName = prefStyleName.isEmpty() ? QApplication::style()->name() : prefStyleName;
|
||||
|
||||
if (selectedStyleName.compare(u"system"_s, Qt::CaseInsensitive) != 0)
|
||||
m_ui->comboStyle->setCurrentText(selectedStyleName);
|
||||
m_ui->comboStyle->setCurrentIndex(m_ui->comboStyle->findText(selectedStyleName, Qt::MatchFixedString));
|
||||
#else
|
||||
m_ui->labelStyle->hide();
|
||||
m_ui->comboStyle->hide();
|
||||
|
|
Loading…
Reference in a new issue