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 | |
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.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/gui/chat.cpp | 14 |
2 files changed, 13 insertions, 2 deletions
@@ -4,6 +4,7 @@ src/gui/equipmentwindow.cpp: Move to top the requested window with shortcuts or with menu button, also corrected the default position of equipment and inventory windows. + * src/gui/chat.cpp: Fixed the Chat Window scrolling bug. 2005-10-02 Bjørn Lindeijer <bjorn@lindeijer.nl> 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) |