summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2020-11-18 15:54:19 +0100
committerronso0 <ronso0@mixxx.org>2020-11-24 23:35:32 +0100
commiteb7fba2cfb4db2dc730308dd2086721e47591013 (patch)
tree321f0dd88d83da76c75b31326fdaa8c91b2c2887
parenta735a490858460d5468af065204d72166202d9d8 (diff)
ColorDelegate: Switch if/else arms
-rw-r--r--src/library/colordelegate.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/colordelegate.cpp b/src/library/colordelegate.cpp
index f44250921c..49d2c4edeb 100644
--- a/src/library/colordelegate.cpp
+++ b/src/library/colordelegate.cpp
@@ -18,13 +18,13 @@ void ColorDelegate::paintItem(
const QModelIndex& index) const {
const auto color = mixxx::RgbColor::fromQVariant(index.data());
- if (!color) {
+ if (color) {
+ painter->fillRect(option.rect, mixxx::RgbColor::toQColor(color));
+ } else {
// Filter out track color that is hidden
if (option.state & QStyle::State_Selected) {
painter->fillRect(option.rect, option.palette.highlight());
}
- } else {
- painter->fillRect(option.rect, mixxx::RgbColor::toQColor(color));
}
// Draw a border if the color cell has focus