From e19cd1911bb21c5889ff1c8068ae983f44fe2bd7 Mon Sep 17 00:00:00 2001 From: Daniel Sage <24928223+dnsge@users.noreply.github.com> Date: Sat, 7 Jan 2023 06:41:52 -0500 Subject: [PATCH] Fix scrollbar highlight colors when changing message history limit (#4288) * Use correct messagesLimit for Scrollbar * Update CHANGELOG.md Co-authored-by: pajlada --- CHANGELOG.md | 1 + src/widgets/Scrollbar.cpp | 3 ++- src/widgets/Scrollbar.hpp | 2 +- src/widgets/helper/ChannelView.cpp | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 933d26169..34e768589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Bugfix: Fixed tooltip images not appearing if mouse hovered only first pixel. (#4268) - Bugfix: Fixed crash that could occur when closing down a split at the wrong time. (#4277) - Bugfix: Fixed crash that could occur when closing down the last of a channel when reloading emotes. (#4278) +- Bugfix: Fixed scrollbar highlight colors when changing message history limit. (#4288) - Dev: Remove protocol from QApplication's Organization Domain (so changed from `https://www.chatterino.com` to `chatterino.com`). (#4256) - Dev: Ignore `WM_SHOWWINDOW` hide events, causing fewer attempted rescales. (#4198) - Dev: Migrated to C++ 20 (#4252, #4257) diff --git a/src/widgets/Scrollbar.cpp b/src/widgets/Scrollbar.cpp index cbd6e4e39..b63e57227 100644 --- a/src/widgets/Scrollbar.cpp +++ b/src/widgets/Scrollbar.cpp @@ -16,9 +16,10 @@ namespace chatterino { -Scrollbar::Scrollbar(ChannelView *parent) +Scrollbar::Scrollbar(size_t messagesLimit, ChannelView *parent) : BaseWidget(parent) , currentValueAnimation_(this, "currentValue_") + , highlights_(messagesLimit) { resize(int(16 * this->scale()), 100); this->currentValueAnimation_.setDuration(150); diff --git a/src/widgets/Scrollbar.hpp b/src/widgets/Scrollbar.hpp index 9590d50dc..41ea34b0c 100644 --- a/src/widgets/Scrollbar.hpp +++ b/src/widgets/Scrollbar.hpp @@ -18,7 +18,7 @@ class Scrollbar : public BaseWidget Q_OBJECT public: - Scrollbar(ChannelView *parent = nullptr); + Scrollbar(size_t messagesLimit, ChannelView *parent = nullptr); void addHighlight(ScrollbarHighlight highlight); void addHighlightsAtStart( diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 6877d79fd..3a2c71db4 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -147,7 +147,7 @@ ChannelView::ChannelView(BaseWidget *parent, Split *split, Context context, size_t messagesLimit) : BaseWidget(parent) , split_(split) - , scrollBar_(new Scrollbar(this)) + , scrollBar_(new Scrollbar(messagesLimit, this)) , highlightAnimation_(this) , context_(context) , messages_(messagesLimit)