mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed freeze when messages get taller when they get higher
This commit is contained in:
parent
c2363e17e7
commit
aba8e1a18f
2 changed files with 6 additions and 4 deletions
|
@ -54,7 +54,7 @@ ChannelView::ChannelView(BaseWidget *parent)
|
|||
|
||||
this->scrollBar.getCurrentValueChanged().connect([this] {
|
||||
// Whenever the scrollbar value has been changed, re-render the ChatWidgetView
|
||||
this->layoutMessages();
|
||||
this->actuallyLayoutMessages(true);
|
||||
this->goToBottom->setVisible(this->enableScrollingToBottom && this->scrollBar.isVisible() &&
|
||||
!this->scrollBar.isAtBottom());
|
||||
|
||||
|
@ -163,7 +163,7 @@ void ChannelView::layoutMessages()
|
|||
// }
|
||||
}
|
||||
|
||||
void ChannelView::actuallyLayoutMessages()
|
||||
void ChannelView::actuallyLayoutMessages(bool causedByScrollbar)
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
|
@ -233,7 +233,9 @@ void ChannelView::actuallyLayoutMessages()
|
|||
this->scrollBar.setVisible(showScrollbar);
|
||||
|
||||
if (!showScrollbar) {
|
||||
this->scrollBar.setDesiredValue(0);
|
||||
if (!causedByScrollbar) {
|
||||
this->scrollBar.setDesiredValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
this->scrollBar.setMaximum(messagesSnapshot.getLength());
|
||||
|
|
|
@ -94,7 +94,7 @@ private:
|
|||
messages::LimitedQueueSnapshot<messages::MessageLayoutPtr> snapshot;
|
||||
|
||||
void detachChannel();
|
||||
void actuallyLayoutMessages();
|
||||
void actuallyLayoutMessages(bool causedByScollbar = false);
|
||||
|
||||
void drawMessages(QPainter &painter);
|
||||
void setSelection(const messages::SelectionItem &start, const messages::SelectionItem &end);
|
||||
|
|
Loading…
Reference in a new issue