summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-04-15 17:03:02 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-04-25 08:38:46 (GMT)
commitef341e4762b1017047555c37dac1dfdc6ba2489d (patch)
treee4b3454c3f7b0fd3523269f193c8402c0bf30c4c /Swift/QtUI/QtWebKitChatView.h
parent511c43aec78279ecaa6008bd7f4f08159d3a5c00 (diff)
downloadswift-ef341e4762b1017047555c37dac1dfdc6ba2489d.zip
swift-ef341e4762b1017047555c37dac1dfdc6ba2489d.tar.bz2
Fix detection of vertical scroll bar position in chat views
Chat views are expected to remember the scroll position. If the user scrolled all the way down, the view should keep scrolled all the way down, even if the windows is resized, new messages are added or the user enters a multi line message in the message input box. Qt WebKit only provides reliable scroll position updates in their web environment. This requires to have scroll changes call a JS hook that calls our C++ signal. Test-Information: Tested and verified the following cases for correct behavior: * entering a multi line message keeping the view scrolled down * resizing the window and keeping it scrolled down * receiving messages and the view keeps being scrolled down * verified that view does not scroll down if it is not yet on resize of the window, entering multi line messages, and receiving new messages Change-Id: I579a07d0b073c34e7a46b0fde1bc09f3da08d5da
Diffstat (limited to 'Swift/QtUI/QtWebKitChatView.h')
-rw-r--r--Swift/QtUI/QtWebKitChatView.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.h b/Swift/QtUI/QtWebKitChatView.h
index 31bf8a5..098c1ac 100644
--- a/Swift/QtUI/QtWebKitChatView.h
+++ b/Swift/QtUI/QtWebKitChatView.h
@@ -124,8 +124,8 @@ namespace Swift {
void handleViewLoadFinished(bool);
void handleFrameSizeChanged();
void handleClearRequested();
- void handleScrollRequested(int dx, int dy, const QRect& rectToScroll);
void handleHTMLButtonClicked(QString id, QString arg1, QString arg2, QString arg3, QString arg4, QString arg5);
+ void handleVerticalScrollBarPositionChanged(double position);
private:
enum PreviousMessageKind {
@@ -159,6 +159,9 @@ namespace Swift {
QString chatMessageToHTML(const ChatWindow::ChatMessage& message);
static QString buildChatWindowButton(const QString& name, const QString& id, const QString& arg1 = QString(), const QString& arg2 = QString(), const QString& arg3 = QString(), const QString& arg4 = QString(), const QString& arg5 = QString());
+ protected:
+ void resizeEvent(QResizeEvent* event) SWIFTEN_OVERRIDE;
+
private:
void headerEncode();
void messageEncode();