mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 09:26:18 -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;
|
typing = false;
|
||||||
peerStatus = 0;
|
peerStatus = 0;
|
||||||
isChatLobby = false;
|
isChatLobby = false;
|
||||||
|
firstShow = true;
|
||||||
|
|
||||||
lastStatusSendTime = 0 ;
|
lastStatusSendTime = 0 ;
|
||||||
chatStyle.setStyleFromSettings(ChatStyle::TYPE_PRIVATE);
|
chatStyle.setStyleFromSettings(ChatStyle::TYPE_PRIVATE);
|
||||||
@ -253,6 +254,13 @@ void ChatWidget::showEvent(QShowEvent */*event*/)
|
|||||||
newMessages = false;
|
newMessages = false;
|
||||||
emit infoChanged(this);
|
emit infoChanged(this);
|
||||||
focusDialog();
|
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*/)
|
void ChatWidget::resizeEvent(QResizeEvent */*event*/)
|
||||||
@ -303,10 +311,6 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
|
|||||||
|
|
||||||
ui->textBrowser->append(formatMsg);
|
ui->textBrowser->append(formatMsg);
|
||||||
|
|
||||||
/* Scroll to the end */
|
|
||||||
QScrollBar *scrollbar = ui->textBrowser->verticalScrollBar();
|
|
||||||
scrollbar->setValue(scrollbar->maximum());
|
|
||||||
|
|
||||||
resetStatusBar();
|
resetStatusBar();
|
||||||
|
|
||||||
if (incoming && chatType == TYPE_NORMAL) {
|
if (incoming && chatType == TYPE_NORMAL) {
|
||||||
|
@ -139,6 +139,8 @@ private:
|
|||||||
ChatStyle chatStyle;
|
ChatStyle chatStyle;
|
||||||
RSStyle style;
|
RSStyle style;
|
||||||
|
|
||||||
|
bool firstShow;
|
||||||
|
|
||||||
Ui::ChatWidget *ui;
|
Ui::ChatWidget *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user