Skip to content

Commit

Permalink
Handle Qt style names in a case insensitive way
Browse files Browse the repository at this point in the history
  • Loading branch information
glassez committed Nov 2, 2024
1 parent 84d8952 commit 295b7e6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gui/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 295b7e6

Please sign in to comment.