mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Fix #266
This commit is contained in:
parent
8b7b6dd08c
commit
3f35a5a48d
|
@ -25,6 +25,7 @@ ChatAreaWidget::ChatAreaWidget(QWidget *parent) :
|
|||
setReadOnly(true);
|
||||
viewport()->setCursor(Qt::ArrowCursor);
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
setUndoRedoEnabled(false);
|
||||
}
|
||||
|
||||
ChatAreaWidget::~ChatAreaWidget()
|
||||
|
@ -82,7 +83,11 @@ void ChatAreaWidget::insertMessage(ChatAction *msgAction)
|
|||
return;
|
||||
|
||||
messages.append(msgAction);
|
||||
updateChatContent();
|
||||
//updateChatContent();
|
||||
|
||||
moveCursor(QTextCursor::End);
|
||||
moveCursor(QTextCursor::PreviousCell);
|
||||
insertHtml(msgAction->getHtml());
|
||||
}
|
||||
|
||||
void ChatAreaWidget::updateChatContent()
|
||||
|
@ -90,7 +95,9 @@ void ChatAreaWidget::updateChatContent()
|
|||
QScrollBar* scroll = verticalScrollBar();
|
||||
lockSliderToBottom = scroll && scroll->value() == scroll->maximum();
|
||||
|
||||
setUpdatesEnabled(false);
|
||||
setHtml(getHtmledMessages());
|
||||
setUpdatesEnabled(true);
|
||||
if (lockSliderToBottom)
|
||||
sliderPosition = scroll->maximum();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user