mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-15 02:44:20 -05: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
@ -842,7 +842,15 @@ void PeersDialog::insertChat()
|
||||
extraTxt.replace(code, "<img src=\"" + i.value() + "\" />");
|
||||
}
|
||||
|
||||
msgWidget->append(extraTxt);
|
||||
if ((msgWidget->verticalScrollBar()->maximum() - 30) < msgWidget->verticalScrollBar()->value() ) {
|
||||
msgWidget->append(extraTxt);
|
||||
} else {
|
||||
//the vertical scroll is not at the bottom, so just update the text, the scroll will stay at the current position
|
||||
int scroll = msgWidget->verticalScrollBar()->value();
|
||||
msgWidget->setHtml(msgWidget->toHtml() + extraTxt);
|
||||
msgWidget->verticalScrollBar()->setValue(scroll);
|
||||
msgWidget->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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…
Reference in New Issue
Block a user