aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghostfeesh <codeviscerate@gmail.com>2018-07-28 09:52:20 +0800
committerGitHub <noreply@github.com>2018-07-28 09:52:20 +0800
commitcab730422f59c9ea75a5e175a3cffdbca097880c (patch)
treeb195cf59bd09ae4af0d9825fb8adc19f5eb219f7
parent22fd5f2804e919b7d4ff0f99ccd5656cabc9c02f (diff)
Write off the rest of move_op and friends
move_op and friends didn't want to cooperate with scrolling
-rw-r--r--courtroom.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/courtroom.cpp b/courtroom.cpp
index eb6a786c..bc0b0ad0 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -1146,21 +1146,18 @@ void Courtroom::append_ic_text(QString p_text, QString p_name)
const QTextCursor old_cursor = ui_ic_chatlog->textCursor();
const int old_scrollbar_value = ui_ic_chatlog->verticalScrollBar()->value();
- QTextCursor::MoveOperation move_op;
int scrollbar_limit;
if(ao_app->ic_scroll_down_enabled()) {
scrollbar_limit = ui_ic_chatlog->verticalScrollBar()->maximum();
- move_op = QTextCursor::End;
+ ui_ic_chatlog->moveCursor(QTextCursor::End);
}
else {
scrollbar_limit = ui_ic_chatlog->verticalScrollBar()->minimum();
- move_op = QTextCursor::Start;
+ ui_ic_chatlog->moveCursor(QTextCursor::Start);
}
const bool is_fully_scrolled = old_scrollbar_value == scrollbar_limit;
-
- ui_ic_chatlog->moveCursor(move_op);
ui_ic_chatlog->textCursor().insertText(p_name, bold);
ui_ic_chatlog->textCursor().insertText(p_text + '\n', normal);