diff options
| author | David Skoland <davidskoland@gmail.com> | 2017-01-30 01:03:11 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2017-01-30 01:03:11 +0100 |
| commit | 3ba2ffca94873df31b505d720101895df783e0cd (patch) | |
| tree | b79c81e00c165361815e9a31e220f5719185f0e3 | |
| parent | 362ec49351e144a514551d4fcf61e1db58b2a8a7 (diff) | |
-
| -rw-r--r-- | courtroom.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/courtroom.cpp b/courtroom.cpp index ebd2ece..adcc237 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -462,9 +462,6 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) { QString f_message = p_contents->at(2) + ": " + p_contents->at(4) + '\n'; - //ui_ic_chatlog->moveCursor(QTextCursor::Start); - //ui_ic_chatlog->insertPlainText(f_message); - const QTextCursor old_cursor = ui_ic_chatlog->textCursor(); const int old_scrollbar_value = ui_ic_chatlog->verticalScrollBar()->value(); const bool is_scrolled_up = old_scrollbar_value == ui_ic_chatlog->verticalScrollBar()->minimum(); @@ -475,7 +472,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) if (old_cursor.hasSelection() || !is_scrolled_up) { - // The user has selected text or scrolled away from the bottom: maintain position. + // The user has selected text or scrolled away from the top: maintain position. ui_ic_chatlog->setTextCursor(old_cursor); ui_ic_chatlog->verticalScrollBar()->setValue(old_scrollbar_value); } @@ -483,7 +480,6 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) { // The user hasn't selected any text and the scrollbar is at the top: scroll to the top. ui_ic_chatlog->moveCursor(QTextCursor::Start); - //ui_ic_chatlog->verticalScrollBar()->setValue(verticalScrollBar()->minimum()); ui_ic_chatlog->verticalScrollBar()->setValue(ui_ic_chatlog->verticalScrollBar()->minimum()); } |
