From 04bc4f2b057c99a7b82ab95973180381824c85ab Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Aug 2011 20:15:17 +0300 Subject: Fix chat auto scroll to down if input field is visible. --- src/gui/widgets/chattab.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index e27af8b25..785bdd6be 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -249,12 +249,13 @@ void ChatTab::chatLog(std::string line, Own own, // 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 (mScrollArea->getVerticalScrollAmount() >= + if (mScrollArea->getVerticalScrollAmount() + 2 >= mScrollArea->getVerticalMaxScroll()) { addRow(line); mScrollArea->setVerticalScrollAmount( mScrollArea->getVerticalMaxScroll()); + } else { -- cgit v1.2.3-60-g2f50