Fix 'First Message' scrollbar highlights not being disabled (#3325)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
- Bugfix: Fixed `QCharRef with an index pointing outside the valid range of a QString` warning that was emitted on every Tab press. (#3234)
|
||||
- Bugfix: Fixed being unable to disable `First Message` highlights (#3293)
|
||||
- Bugfix: Fixed `First Message` custom sound not persisting through restart. (#3303)
|
||||
- Bugfix: Fixed `First Message` scrollbar highlights not being disabled. (#3325)
|
||||
- Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103)
|
||||
- Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038)
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ SBHighlight Message::getScrollBarHighlight() const
|
||||
{
|
||||
return SBHighlight(
|
||||
ColorProvider::instance().color(ColorType::FirstMessageHighlight),
|
||||
SBHighlight::Default, true);
|
||||
SBHighlight::Default, false, true);
|
||||
}
|
||||
return SBHighlight();
|
||||
}
|
||||
|
||||
@@ -251,6 +251,8 @@ void Scrollbar::paintEvent(QPaintEvent *)
|
||||
painter.fillRect(rect(), this->theme->scrollbars.background);
|
||||
|
||||
bool enableRedeemedHighlights = getSettings()->enableRedeemedHighlight;
|
||||
bool enableFirstMessageHighlights =
|
||||
getSettings()->enableFirstMessageHighlight;
|
||||
|
||||
// painter.fillRect(QRect(xOffset, 0, width(), this->buttonHeight),
|
||||
// this->themeManager->ScrollbarArrow);
|
||||
@@ -301,6 +303,12 @@ void Scrollbar::paintEvent(QPaintEvent *)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (highlight.isFirstMessageHighlight() &&
|
||||
!enableFirstMessageHighlights)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
QColor color = highlight.getColor();
|
||||
color.setAlpha(255);
|
||||
|
||||
|
||||
@@ -13,10 +13,12 @@ ScrollbarHighlight::ScrollbarHighlight()
|
||||
}
|
||||
|
||||
ScrollbarHighlight::ScrollbarHighlight(const std::shared_ptr<QColor> color,
|
||||
Style style, bool isRedeemedHighlight)
|
||||
Style style, bool isRedeemedHighlight,
|
||||
bool isFirstMessageHighlight)
|
||||
: color_(color)
|
||||
, style_(style)
|
||||
, isRedeemedHighlight_(isRedeemedHighlight)
|
||||
, isFirstMessageHighlight_(isFirstMessageHighlight)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -35,6 +37,11 @@ bool ScrollbarHighlight::isRedeemedHighlight() const
|
||||
return this->isRedeemedHighlight_;
|
||||
}
|
||||
|
||||
bool ScrollbarHighlight::isFirstMessageHighlight() const
|
||||
{
|
||||
return this->isFirstMessageHighlight_;
|
||||
}
|
||||
|
||||
bool ScrollbarHighlight::isNull() const
|
||||
{
|
||||
return this->style_ == None;
|
||||
|
||||
@@ -21,17 +21,20 @@ public:
|
||||
ScrollbarHighlight();
|
||||
|
||||
ScrollbarHighlight(const std::shared_ptr<QColor> color,
|
||||
Style style = Default, bool isRedeemedHighlight = false);
|
||||
Style style = Default, bool isRedeemedHighlight = false,
|
||||
bool isFirstMessageHighlight = false);
|
||||
|
||||
QColor getColor() const;
|
||||
Style getStyle() const;
|
||||
bool isRedeemedHighlight() const;
|
||||
bool isFirstMessageHighlight() const;
|
||||
bool isNull() const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<QColor> color_;
|
||||
Style style_;
|
||||
bool isRedeemedHighlight_;
|
||||
bool isFirstMessageHighlight_;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user