summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-07-06 15:32:49 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-07-10 11:54:13 (GMT)
commit8867a5e938bcfd9ddb55830373dd46b45daca1d9 (patch)
treef6c61be8e9aef0be333029ee93912be651711828
parentf86ecc365a4efbde5dc388af7b083cb2b7908999 (diff)
downloadswift-8867a5e938bcfd9ddb55830373dd46b45daca1d9.zip
swift-8867a5e938bcfd9ddb55830373dd46b45daca1d9.tar.bz2
Stay scrolled at bottom of chat view during a file transfer
Swift did not remember the correct scrolled-at-bottom position for the current chat view after it added/updated file-transfer UI to the chat view. Test-Information: Tested with two Swift instances (one with the fix, one without) and send files in both directions. The instance with this fix, scrolls down along with new messages as they are recevied if the chat view is scrolled to the bottom. Change-Id: Ia9afa68254c3add5f7677b1f4b7ed3c7e1edcf6f
-rw-r--r--Swift/QtUI/QtWebKitChatView.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp
index 57706d4..0c82e73 100644
--- a/Swift/QtUI/QtWebKitChatView.cpp
+++ b/Swift/QtUI/QtWebKitChatView.cpp
@@ -416,10 +416,11 @@ static QWebElement findElementWithID(QWebElement document, QString elementName,
416 } 416 }
417 return QWebElement(); 417 return QWebElement();
418} 418}
419 419
420void QtWebKitChatView::setFileTransferProgress(QString id, const int percentageDone) { 420void QtWebKitChatView::setFileTransferProgress(QString id, const int percentageDone) {
421 rememberScrolledToBottom();
421 QWebElement ftElement = findElementWithID(document_, "div", id); 422 QWebElement ftElement = findElementWithID(document_, "div", id);
422 if (ftElement.isNull()) { 423 if (ftElement.isNull()) {
423 SWIFT_LOG(debug) << "Tried to access FT UI via invalid id!" << std::endl; 424 SWIFT_LOG(debug) << "Tried to access FT UI via invalid id!" << std::endl;
424 return; 425 return;
425 } 426 }
@@ -429,10 +430,11 @@ void QtWebKitChatView::setFileTransferProgress(QString id, const int percentageD
429 QWebElement progressBarValue = ftElement.findFirst("div.progressbar-value"); 430 QWebElement progressBarValue = ftElement.findFirst("div.progressbar-value");
430 progressBarValue.setInnerXml(QString::number(percentageDone) + " %"); 431 progressBarValue.setInnerXml(QString::number(percentageDone) + " %");
431} 432}
432 433
433void QtWebKitChatView::setFileTransferStatus(QString id, const ChatWindow::FileTransferState state, const QString& /* msg */) { 434void QtWebKitChatView::setFileTransferStatus(QString id, const ChatWindow::FileTransferState state, const QString& /* msg */) {
435 rememberScrolledToBottom();
434 QWebElement ftElement = findElementWithID(document_, "div", id); 436 QWebElement ftElement = findElementWithID(document_, "div", id);
435 if (ftElement.isNull()) { 437 if (ftElement.isNull()) {
436 SWIFT_LOG(debug) << "Tried to access FT UI via invalid id! id = " << Q2PSTRING(id) << std::endl; 438 SWIFT_LOG(debug) << "Tried to access FT UI via invalid id! id = " << Q2PSTRING(id) << std::endl;
437 return; 439 return;
438 } 440 }