Mercurial > minori
comparison src/gui/dialog/settings/application.cc @ 187:9613d72b097e
*: multiple performance improvements
like marking `static const` when it makes sense...
date: change old stupid heap-based method to a structure which should
make copying the thing actually make a copy.
also many performance-based changes, like removing the std::tie
dependency and forward-declaring nlohmann json
*: replace every instance of QString::fromUtf8 to Strings::ToQString.
the main difference is that our function will always convert exactly
what is in the string, while some other times it would only convert
up to the nearest NUL byte
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 06 Dec 2023 13:43:54 -0500 |
parents | 80f49f623d30 |
children | 649786bae914 |
comparison
equal
deleted
inserted
replaced
186:6ef31dbb90ca | 187:9613d72b097e |
---|---|
126 appearance_layout->addWidget(locale_combo_box); | 126 appearance_layout->addWidget(locale_combo_box); |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 { | 130 { |
131 /* Application theme */ | |
132 { | |
133 QLabel* theme_combo_box_label = new QLabel(tr("Application theme:"), appearance_group_box); | |
134 appearance_layout->addWidget(theme_combo_box_label); | |
135 } | |
136 | |
137 { | |
138 QComboBox* theme_combo_box = new QComboBox(appearance_group_box); | |
139 theme_combo_box->addItem(tr("Default")); | |
140 theme_combo_box->addItem(tr("Light")); | |
141 theme_combo_box->addItem(tr("Dark")); | |
142 connect(theme_combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this, | |
143 [this](int index) { theme = static_cast<Themes>(index); }); | |
144 theme_combo_box->setCurrentIndex(static_cast<int>(theme)); | |
145 appearance_layout->addWidget(theme_combo_box); | |
146 } | |
147 } | |
148 | |
149 { | |
131 /* Hopefully I made this easy to parse... */ | 150 /* Hopefully I made this easy to parse... */ |
132 QCheckBox* hl_above_anime_box = new QCheckBox(tr("Display highlighted anime above others"), appearance_group_box); | 151 QCheckBox* hl_above_anime_box = new QCheckBox(tr("Display highlighted anime above others"), appearance_group_box); |
133 hl_above_anime_box->setCheckState(highlighted_anime_above_others ? Qt::Checked : Qt::Unchecked); | 152 hl_above_anime_box->setCheckState(highlighted_anime_above_others ? Qt::Checked : Qt::Unchecked); |
134 hl_above_anime_box->setEnabled(highlight_anime_if_available); | 153 hl_above_anime_box->setEnabled(highlight_anime_if_available); |
135 hl_above_anime_box->setContentsMargins(10, 0, 0, 0); | 154 hl_above_anime_box->setContentsMargins(10, 0, 0, 0); |