mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-26 19:20:32 +00:00
Handle Qt style names in a case insensitive way
PR #21720. Closes #21716.
This commit is contained in:
parent
6f642776b6
commit
b083029841
@ -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 New Issue
Block a user