summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorronso0 <ronso0@mixxx.org>2021-02-26 00:07:10 +0100
committerronso0 <ronso0@mixxx.org>2021-02-26 00:36:20 +0100
commitd4aa0592416d5fe7e5270e77e2bdcadb2917a928 (patch)
tree2f1d23dfcaed6d63940c5ead701bbbe648d04105 /src
parentb0103a4948ca775f908fdb1ca528eb973e91d406 (diff)
WEffectSelector: make 'no effect' topmost list item
Diffstat (limited to 'src')
-rw-r--r--src/widget/weffectselector.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/widget/weffectselector.cpp b/src/widget/weffectselector.cpp
index 4480ef0301..acea20e30e 100644
--- a/src/widget/weffectselector.cpp
+++ b/src/widget/weffectselector.cpp
@@ -57,6 +57,10 @@ void WEffectSelector::populate() {
m_pEffectsManager->getVisibleEffectManifests();
QFontMetrics metrics(font());
+ // Add empty item: no effect
+ addItem(EffectsManager::kNoEffectString);
+ setItemData(0, QVariant(tr("No effect loaded.")), Qt::ToolTipRole);
+
for (int i = 0; i < visibleEffectManifests.size(); ++i) {
const EffectManifestPointer pManifest = visibleEffectManifests.at(i);
QString elidedDisplayName = metrics.elidedText(pManifest->displayName(),
@@ -68,13 +72,11 @@ void WEffectSelector::populate() {
QString description = pManifest->description();
// <b> makes the effect name bold. Also, like <span> it serves as hack
// to get Qt to treat the string as rich text so it automatically wraps long lines.
- setItemData(i, QVariant(QStringLiteral("<b>") + name + QStringLiteral("</b><br/>") +
- description), Qt::ToolTipRole);
- }
- // Add empty item, no effect
- addItem(EffectsManager::kNoEffectString);
- setItemData(visibleEffectManifests.size(), QVariant(tr("No effect loaded.")),
+ setItemData(i + 1,
+ QVariant(QStringLiteral("<b>") + name +
+ QStringLiteral("</b><br/>") + description),
Qt::ToolTipRole);
+ }
slotEffectUpdated();
blockSignals(false);