mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
Removed scroll to the end in ChatWidget (private chat and chat lobby) when the scrollbar is not at the end.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4835 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5529588a1f
commit
fadc86b189
@ -60,6 +60,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
||||
typing = false;
|
||||
peerStatus = 0;
|
||||
isChatLobby = false;
|
||||
firstShow = true;
|
||||
|
||||
lastStatusSendTime = 0 ;
|
||||
chatStyle.setStyleFromSettings(ChatStyle::TYPE_PRIVATE);
|
||||
@ -253,6 +254,13 @@ void ChatWidget::showEvent(QShowEvent */*event*/)
|
||||
newMessages = false;
|
||||
emit infoChanged(this);
|
||||
focusDialog();
|
||||
|
||||
if (firstShow) {
|
||||
// Workaround: now the scroll position is correct calculated
|
||||
firstShow = false;
|
||||
QScrollBar *scrollbar = ui->textBrowser->verticalScrollBar();
|
||||
scrollbar->setValue(scrollbar->maximum());
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::resizeEvent(QResizeEvent */*event*/)
|
||||
@ -303,10 +311,6 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
|
||||
|
||||
ui->textBrowser->append(formatMsg);
|
||||
|
||||
/* Scroll to the end */
|
||||
QScrollBar *scrollbar = ui->textBrowser->verticalScrollBar();
|
||||
scrollbar->setValue(scrollbar->maximum());
|
||||
|
||||
resetStatusBar();
|
||||
|
||||
if (incoming && chatType == TYPE_NORMAL) {
|
||||
|
@ -139,6 +139,8 @@ private:
|
||||
ChatStyle chatStyle;
|
||||
RSStyle style;
|
||||
|
||||
bool firstShow;
|
||||
|
||||
Ui::ChatWidget *ui;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user