mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-01 18:56:23 -04:00
tweak the peer chat and group chat vertical scroll
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1848 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
046ec8c6a7
commit
97d8640f3a
2 changed files with 18 additions and 2 deletions
|
@ -289,7 +289,15 @@ std::cout << "PopupChatDialog:addChatMsg message : " << message.toStdString() <<
|
|||
.replace("%name%", name)
|
||||
.replace("%message%", message);
|
||||
|
||||
ui.textBrowser->append(formatMsg + "\n");
|
||||
if ((ui.textBrowser->verticalScrollBar()->maximum() - 30) < ui.textBrowser->verticalScrollBar()->value() ) {
|
||||
ui.textBrowser->append(formatMsg + "\n");
|
||||
} else {
|
||||
//the vertical scroll is not at the bottom, so just update the text, the scroll will stay at the current position
|
||||
int scroll = ui.textBrowser->verticalScrollBar()->value();
|
||||
ui.textBrowser->setHtml(ui.textBrowser->toHtml() + formatMsg + "\n");
|
||||
ui.textBrowser->verticalScrollBar()->setValue(scroll);
|
||||
ui.textBrowser->update();
|
||||
}
|
||||
resetStatusBar() ;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue