Skip to content

Commit

Permalink
fix(lazy-layout): scroll to bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Sep 7, 2023
1 parent 66ed6a3 commit ec0cddb
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/widgets/helper/ChannelView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,15 @@ void ChannelView::initializeLayout()
void ChannelView::initializeScrollbar()
{
this->scrollBar_->getCurrentValueChanged().connect([this] {
this->performLayout(true);
this->queueUpdate();
if (this->isVisible() || !getSettings()->lazyChannelLayout)
{
this->performLayout(true);
this->queueUpdate();
}
else
{
this->layoutQueued_ = true;
}
});
}

Expand Down Expand Up @@ -922,6 +929,11 @@ void ChannelView::messageAppended(MessagePtr &message,
else
{
this->scrollBar_->offsetMinimum(1);
if (this->showingLatestMessages_ && !this->isVisible() &&
getSettings()->lazyChannelLayout)
{
this->scrollBar_->scrollToBottom(false);
}
this->selection_.shiftMessageIndex(1);
}
}
Expand Down

0 comments on commit ec0cddb

Please sign in to comment.