summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-10-04 13:49:43 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-10-04 13:49:43 +0000
commit7333a74b2c59c5baa4dbd987df7624cdab13585a (patch)
treeae718d0a2c275fb42ef1ab3d8d8f20a4aeefa755
parent342c0fae5ec4fd4f653618008ef90eec14200d00 (diff)
downloadmana-7333a74b2c59c5baa4dbd987df7624cdab13585a.tar.gz
mana-7333a74b2c59c5baa4dbd987df7624cdab13585a.tar.bz2
mana-7333a74b2c59c5baa4dbd987df7624cdab13585a.tar.xz
mana-7333a74b2c59c5baa4dbd987df7624cdab13585a.zip
Fixed the chat window scrolling bug.
-rw-r--r--ChangeLog1
-rw-r--r--src/gui/chat.cpp14
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a2ff2470..0f134986 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)