summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/chattab.cpp19
-rw-r--r--src/gui/widgets/chattab.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 2fd7840f8..3c277fc8d 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -249,6 +249,9 @@ void ChatTab::chatLog(std::string line, Own own,
addRow(line);
}
+ if (chatWindow && this == localChatTab)
+ chatWindow->addToAwayLog(line);
+
mScrollArea->logic();
if (own != BY_PLAYER)
{
@@ -434,3 +437,19 @@ void ChatTab::loadFromLogFile(std::string name)
}
}
}
+
+void ChatTab::addNewRow(std::string &line)
+{
+ if (mScrollArea->getVerticalScrollAmount() >=
+ mScrollArea->getVerticalMaxScroll())
+ {
+ addRow(line);
+ mScrollArea->setVerticalScrollAmount(
+ mScrollArea->getVerticalMaxScroll());
+ }
+ else
+ {
+ addRow(line);
+ }
+ mScrollArea->logic();
+} \ No newline at end of file
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index 66e9f637d..45e27797d 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -159,6 +159,8 @@ class ChatTab : public Tab
void setNoAway(bool n)
{ mNoAway = n; }
+ void addNewRow(std::string &line);
+
protected:
friend class ChatWindow;
friend class WhisperWindow;