diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/chat.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index d0a98d7f..a091abc9 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -169,8 +169,18 @@ void ChatWindow::chat_log(std::string line, int own) line = lineColor + timeStr.str() + tmp.nick + line; - textOutput->addRow(line); - scrollArea->setVerticalScrollAmount(scrollArea->getVerticalMaxScroll()); + // We look if the Vertical Scroll Bar is set at the max before + // adding a row, otherwise the max will always be a row higher + // at comparison. + if ( scrollArea->getVerticalScrollAmount() == scrollArea->getVerticalMaxScroll() ) + { + textOutput->addRow(line); + scrollArea->setVerticalScrollAmount(scrollArea->getVerticalMaxScroll()); + } + else + { + textOutput->addRow(line); + } } void ChatWindow::chat_log(CHATSKILL action) |