diff --git a/src/widgets/Scrollbar.cpp b/src/widgets/Scrollbar.cpp index c581723b6..adbd8e4d1 100644 --- a/src/widgets/Scrollbar.cpp +++ b/src/widgets/Scrollbar.cpp @@ -287,36 +287,38 @@ void Scrollbar::paintEvent(QPaintEvent *) int highlightHeight = int(std::ceil(std::max(this->scale() * 2, dY))); - for (size_t i = 0; i < snapshotLength; i++) + for (size_t i = 0; i < snapshotLength; i++, y += dY) { ScrollbarHighlight const &highlight = snapshot[i]; - if (!highlight.isNull()) + if (highlight.isNull()) { - if (!highlight.isRedeemedHighlight() || enableRedeemedHighlights) - { - QColor color = highlight.getColor(); - color.setAlpha(255); - - switch (highlight.getStyle()) - { - case ScrollbarHighlight::Default: { - painter.fillRect(w / 8 * 3, int(y), w / 4, - highlightHeight, color); - } - break; - - case ScrollbarHighlight::Line: { - painter.fillRect(0, int(y), w, 1, color); - } - break; - - case ScrollbarHighlight::None:; - } - } + continue; } - y += dY; + if (highlight.isRedeemedHighlight() && !enableRedeemedHighlights) + { + continue; + } + + QColor color = highlight.getColor(); + color.setAlpha(255); + + switch (highlight.getStyle()) + { + case ScrollbarHighlight::Default: { + painter.fillRect(w / 8 * 3, int(y), w / 4, highlightHeight, + color); + } + break; + + case ScrollbarHighlight::Line: { + painter.fillRect(0, int(y), w, 1, color); + } + break; + + case ScrollbarHighlight::None:; + } } }