diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-10-04 13:49:43 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-10-04 13:49:43 +0000 |
commit | 7333a74b2c59c5baa4dbd987df7624cdab13585a (patch) | |
tree | ae718d0a2c275fb42ef1ab3d8d8f20a4aeefa755 /src | |
parent | 342c0fae5ec4fd4f653618008ef90eec14200d00 (diff) | |
download | mana-7333a74b2c59c5baa4dbd987df7624cdab13585a.tar.gz mana-7333a74b2c59c5baa4dbd987df7624cdab13585a.tar.bz2 mana-7333a74b2c59c5baa4dbd987df7624cdab13585a.tar.xz mana-7333a74b2c59c5baa4dbd987df7624cdab13585a.zip |
Fixed the chat window scrolling bug.
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) |