From a3e010b84265f1e3abb9ade23bf59dc230ce1ecf Mon Sep 17 00:00:00 2001 From: joss17 Date: Sat, 26 Sep 2009 19:18:20 +0000 Subject: [PATCH] improve chat scrollbar git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1693 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/PeersDialog.cpp | 3 ++- retroshare-gui/src/gui/chat/PopupChatDialog.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/PeersDialog.cpp b/retroshare-gui/src/gui/PeersDialog.cpp index 6675ed9f8..6ade7b5ab 100644 --- a/retroshare-gui/src/gui/PeersDialog.cpp +++ b/retroshare-gui/src/gui/PeersDialog.cpp @@ -779,7 +779,8 @@ void PeersDialog::insertChat() QScrollBar *qsb = msgWidget->verticalScrollBar(); int oldQsbValue = qsb->value(); - bool maxQsbValue = (qsb->maximum() == qsb->value()); + //check if the scroll bar is at the bottom. If t is, we will putt it at the bottom after the new message + bool maxQsbValue = ((qsb->maximum() - 30) < qsb->value()); msgWidget->setHtml(currenttxt); msgWidget->update(); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 904be3eb5..d58db6978 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -222,7 +222,8 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci) //store the state of the vertical scrollbar to set it at the end of the function QScrollBar *qsb = ui.textBrowser->verticalScrollBar(); int oldQsbValue = qsb->value(); - bool maxQsbValue = (qsb->maximum() == qsb->value()); + //check if the scroll bar is at the bottom. If t is, we will putt it at the bottom after the new message + bool maxQsbValue = ((qsb->maximum() - 30) < qsb->value()); bool offline = true;