mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 08:29:32 -05:00
Fixed scroll position of the text browser in the chat dialog when the friend changes the status and the info frame is shown or hidden.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4983 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bd7fe9f53d
commit
9ab7920a7a
@ -611,6 +611,10 @@ void ChatWidget::updateStatus(const QString &peer_id, int status)
|
||||
|
||||
QString peerName = QString::fromUtf8(rsPeers->getPeerName(peerId).c_str());
|
||||
|
||||
// is scrollbar at the end?
|
||||
QScrollBar *scrollbar = ui->textBrowser->verticalScrollBar();
|
||||
bool atEnd = (scrollbar->value() == scrollbar->maximum());
|
||||
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
ui->infoframe->setVisible(true);
|
||||
@ -642,6 +646,11 @@ void ChatWidget::updateStatus(const QString &peer_id, int status)
|
||||
|
||||
peerStatus = status;
|
||||
|
||||
if (atEnd) {
|
||||
// scroll to the end
|
||||
scrollbar->setValue(scrollbar->maximum());
|
||||
}
|
||||
|
||||
emit infoChanged(this);
|
||||
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user