diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dfc30ca4..2cf916103 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Bugfix: Fixed split tooltip getting stuck in some cases. (#5309) - Bugfix: Fixed the version string not showing up as expected in Finder on macOS. (#5311) - Bugfix: Fixed links having `http://` added to the beginning in certain cases. (#5323) +- Bugfix: Fixed a gap appearing when using filters on `/watching`. (#5329) ## 2.5.0-beta.1 diff --git a/src/messages/LimitedQueue.hpp b/src/messages/LimitedQueue.hpp index 62fd02527..e06e5a0f2 100644 --- a/src/messages/LimitedQueue.hpp +++ b/src/messages/LimitedQueue.hpp @@ -24,14 +24,6 @@ public: private: /// Property Accessors - /** - * @brief Return the limit of the internal buffer - */ - [[nodiscard]] size_t limit() const - { - return this->limit_; - } - /** * @brief Return the amount of space left in the buffer * @@ -43,6 +35,14 @@ private: } public: + /** + * @brief Return the limit of the queue + */ + [[nodiscard]] size_t limit() const + { + return this->limit_; + } + /** * @brief Return true if the buffer is empty */ diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index c76373d56..c5a679727 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -982,8 +982,7 @@ void ChannelView::setChannel(const ChannelPtr &underlyingChannel) // and the ui. auto snapshot = underlyingChannel->getMessageSnapshot(); - this->scrollBar_->setMaximum(qreal(snapshot.size())); - + size_t nMessagesAdded = 0; for (const auto &msg : snapshot) { if (!this->shouldIncludeMessage(msg)) @@ -1007,12 +1006,16 @@ void ChannelView::setChannel(const ChannelPtr &underlyingChannel) this->messages_.pushBack(messageLayout); this->channel_->addMessage(msg); + nMessagesAdded++; if (this->showScrollbarHighlights()) { this->scrollBar_->addHighlight(msg->getScrollBarHighlight()); } } + this->scrollBar_->setMaximum( + static_cast(std::min(nMessagesAdded, this->messages_.limit()))); + // // Standard channel connections //