Only layout visible ChannelViews (#4811)

This commit is contained in:
nerix
2023-09-10 17:08:13 +02:00
committed by GitHub
parent 1b9ee939bb
commit 283ede86ad
3 changed files with 42 additions and 28 deletions
+5 -6
View File
@@ -181,6 +181,7 @@ protected:
void mouseDoubleClickEvent(QMouseEvent *event) override;
void hideEvent(QHideEvent *) override;
void showEvent(QShowEvent *event) override;
void handleLinkClick(QMouseEvent *event, const Link &link,
MessageLayout *layout);
@@ -200,11 +201,12 @@ private:
void messageReplaced(size_t index, MessagePtr &replacement);
void messagesUpdated();
void performLayout(bool causedByScrollbar = false);
void performLayout(bool causedByScrollbar = false,
bool causedByShow = false);
void layoutVisibleMessages(
const LimitedQueueSnapshot<MessageLayoutPtr> &messages);
void updateScrollbar(const LimitedQueueSnapshot<MessageLayoutPtr> &messages,
bool causedByScrollbar);
bool causedByScrollbar, bool causedByShow);
void drawMessages(QPainter &painter);
void setSelection(const SelectionItem &start, const SelectionItem &end);
@@ -256,11 +258,8 @@ private:
void showReplyThreadPopup(const MessagePtr &message);
bool canReplyToMessages() const;
QTimer *layoutCooldown_{};
bool layoutQueued_{};
bool layoutQueued_ = false;
QTimer updateTimer_;
bool updateQueued_ = false;
bool lastMessageHasAlternateBackground_ = false;
bool lastMessageHasAlternateBackgroundReverse_ = true;