summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Voicu <vladvoic@gmail.com>2011-04-19 08:49:45 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-04-19 17:58:34 (GMT)
commit18c1e44ad0a60e887a5b1f0d9a38e4be6ad2d722 (patch)
tree7bf0764a4474f9d70dc2cca769569ba31d1c1791 /SwifTools/LastLineTracker.cpp
parent0f96561861ad00ee7a23cd1e368025c20811e1ba (diff)
downloadswift-18c1e44ad0a60e887a5b1f0d9a38e4be6ad2d722.zip
swift-18c1e44ad0a60e887a5b1f0d9a38e4be6ad2d722.tar.bz2
Use a bar to show where the last read messages in a chat are
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'SwifTools/LastLineTracker.cpp')
-rw-r--r--SwifTools/LastLineTracker.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/SwifTools/LastLineTracker.cpp b/SwifTools/LastLineTracker.cpp
new file mode 100644
index 0000000..a7360a8
--- /dev/null
+++ b/SwifTools/LastLineTracker.cpp
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011 Vlad Voicu
+ * Licensed under the Simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include "LastLineTracker.h"
+
+using namespace Swift;
+
+LastLineTracker::LastLineTracker() {
+ lastFocus = true;
+ shouldMove = false;
+}
+
+void LastLineTracker::setHasFocus(bool focus) {
+ if (!focus && lastFocus) {
+ shouldMove = true;
+ lastFocus = focus;
+ return;
+ }
+ shouldMove = false;
+ lastFocus = focus;
+}
+
+bool LastLineTracker::getShouldMoveLastLine() {
+ bool ret = shouldMove;
+ shouldMove = false;
+ return ret;
+}