mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 09:35:08 -07:00
[Chat] Scroll chat view to bottom when loading chat history (#7079)
* [Chat] Scroll chat view to bottom when loading chat history (#2725) Took 4 minutes Took 38 seconds * Harden scrolling to bottom Took 11 minutes * Implement stick-to-bottom flag --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
ef3929356b
commit
ce2c31424c
2 changed files with 36 additions and 3 deletions
|
|
@ -60,6 +60,7 @@ private:
|
|||
QStringList highlightedWords;
|
||||
bool evenNumber;
|
||||
bool showTimestamps;
|
||||
bool stickToBottom = false;
|
||||
HoveredItemType hoveredItemType;
|
||||
QString hoveredContent;
|
||||
QAction *messageClicked;
|
||||
|
|
@ -67,6 +68,7 @@ private:
|
|||
|
||||
[[nodiscard]] QTextFragment getFragmentUnderMouse(const QPoint &pos) const;
|
||||
QTextCursor prepareBlock(bool same = false);
|
||||
void scrollToBottom();
|
||||
void appendCardTag(QTextCursor &cursor, const QString &cardName);
|
||||
void appendUrlTag(QTextCursor &cursor, QString url);
|
||||
static QColor getCustomMentionColor();
|
||||
|
|
@ -88,6 +90,8 @@ private slots:
|
|||
void actMessageClicked();
|
||||
void adjustColorsToPalette();
|
||||
void refreshBlockColors();
|
||||
void onScrollBarRangeChanged();
|
||||
void onScrollBarValueChanged(int value);
|
||||
|
||||
public:
|
||||
ChatView(TabSupervisor *_tabSupervisor, AbstractGame *_game, bool _showTimestamps, QWidget *parent = nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue