diff --git a/CHANGELOG.md b/CHANGELOG.md index 60289dff212..2cb5307aaed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -142,7 +142,7 @@ - Dev: 7TV's `entitlement.reset` is now explicitly ignored. (#5685) - Dev: Qt 6.8 and later now default to the GDI fontengine. (#5710) - Dev: Moved to condition variables when shutting down worker threads. (#5721, #5733) -- Dev: Reduced layouts in channel views when setting a channel. (#5737) +- Dev: Reduced layouts in channel views when setting a channel. (#5737, #5748) ## 2.5.1 diff --git a/src/widgets/dialogs/EmotePopup.cpp b/src/widgets/dialogs/EmotePopup.cpp index afad9dab516..30a3e9d62e1 100644 --- a/src/widgets/dialogs/EmotePopup.cpp +++ b/src/widgets/dialogs/EmotePopup.cpp @@ -168,10 +168,11 @@ void addTwitchEmoteSets(const std::shared_ptr &local, void loadEmojis(ChannelView &view, const std::vector &emojiMap) { ChannelPtr emojiChannel(new Channel("", Channel::Type::None)); + // set the channel first to make sure the scrollbar is at the top + view.setChannel(emojiChannel); + emojiChannel->addMessage(makeEmojiMessage(emojiMap), MessageContext::Original); - - view.setChannel(emojiChannel); } void loadEmojis(Channel &channel, const std::vector &emojiMap, diff --git a/src/widgets/dialogs/ReplyThreadPopup.cpp b/src/widgets/dialogs/ReplyThreadPopup.cpp index ea014d0787f..eca2c75427b 100644 --- a/src/widgets/dialogs/ReplyThreadPopup.cpp +++ b/src/widgets/dialogs/ReplyThreadPopup.cpp @@ -237,9 +237,6 @@ void ReplyThreadPopup::addMessagesFromThread() sourceChannel->getName(), Channel::Type::None); } - this->ui_.threadView->setChannel(this->virtualChannel_); - this->ui_.threadView->setSourceChannel(sourceChannel); - auto rootOverrideFlags = std::optional(this->thread_->root()->flags); rootOverrideFlags->set(MessageFlag::DoNotLog); @@ -258,6 +255,9 @@ void ReplyThreadPopup::addMessagesFromThread() } } + this->ui_.threadView->setChannel(this->virtualChannel_); + this->ui_.threadView->setSourceChannel(sourceChannel); + this->messageConnection_ = std::make_unique( sourceChannel->messageAppended.connect( diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 6873f2cb1a3..83eb0a42df2 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1074,6 +1074,13 @@ void ChannelView::setChannel(const ChannelPtr &underlyingChannel) this->updateID(); this->queueLayout(); + if (!this->isVisible() && !this->scrollBar_->isVisible()) + { + // If we're not visible and the scrollbar is not (yet) visible, + // we need to make sure that it's at the bottom when this view is laid + // out later. + this->scrollBar_->scrollToBottom(); + } this->queueUpdate(); // Notifications