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] {
|
this->scrollBar.getCurrentValueChanged().connect([this] {
|
||||||
// Whenever the scrollbar value has been changed, re-render the ChatWidgetView
|
// 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->goToBottom->setVisible(this->enableScrollingToBottom && this->scrollBar.isVisible() &&
|
||||||
!this->scrollBar.isAtBottom());
|
!this->scrollBar.isAtBottom());
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ void ChannelView::layoutMessages()
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelView::actuallyLayoutMessages()
|
void ChannelView::actuallyLayoutMessages(bool causedByScrollbar)
|
||||||
{
|
{
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
|
@ -233,8 +233,10 @@ void ChannelView::actuallyLayoutMessages()
|
||||||
this->scrollBar.setVisible(showScrollbar);
|
this->scrollBar.setVisible(showScrollbar);
|
||||||
|
|
||||||
if (!showScrollbar) {
|
if (!showScrollbar) {
|
||||||
|
if (!causedByScrollbar) {
|
||||||
this->scrollBar.setDesiredValue(0);
|
this->scrollBar.setDesiredValue(0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this->scrollBar.setMaximum(messagesSnapshot.getLength());
|
this->scrollBar.setMaximum(messagesSnapshot.getLength());
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ private:
|
||||||
messages::LimitedQueueSnapshot<messages::MessageLayoutPtr> snapshot;
|
messages::LimitedQueueSnapshot<messages::MessageLayoutPtr> snapshot;
|
||||||
|
|
||||||
void detachChannel();
|
void detachChannel();
|
||||||
void actuallyLayoutMessages();
|
void actuallyLayoutMessages(bool causedByScollbar = false);
|
||||||
|
|
||||||
void drawMessages(QPainter &painter);
|
void drawMessages(QPainter &painter);
|
||||||
void setSelection(const messages::SelectionItem &start, const messages::SelectionItem &end);
|
void setSelection(const messages::SelectionItem &start, const messages::SelectionItem &end);
|
||||||
|
|
Loading…
Reference in a new issue