diff options
-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) |