fix: scroll to bottom when setting a channel (#5748)

This commit is contained in:
nerix
2024-12-02 16:59:17 +01:00
committed by GitHub
parent 8faf243e3e
commit 3c2a422243
4 changed files with 14 additions and 6 deletions
+3 -2
View File
@@ -168,10 +168,11 @@ void addTwitchEmoteSets(const std::shared_ptr<const EmoteMap> &local,
void loadEmojis(ChannelView &view, const std::vector<EmojiPtr> &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<EmojiPtr> &emojiMap,
+3 -3
View File
@@ -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<MessageFlags>(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<pajlada::Signals::ScopedConnection>(
sourceChannel->messageAppended.connect(