summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorJoanna Hulboj <joanna.hulboj@isode.com>2017-02-27 09:16:50 (GMT)
committerKevin Smith <kevin.smith@isode.com>2017-02-28 14:22:41 (GMT)
commitb6fd152bf02199cf0a287af6031d75ccb8ae6117 (patch)
tree520c3505a4e390a946ced76fc11bd11cf7f74a2f /Swift
parent049a95e4e1a4e981cd7a9f9f591f04ce94178548 (diff)
downloadswift-b6fd152bf02199cf0a287af6031d75ccb8ae6117.zip
swift-b6fd152bf02199cf0a287af6031d75ccb8ae6117.tar.bz2
Do not reset font size when clearing chat view
Test-Information: From Swift open any chat window, type something, right click on chat view and increase font size 3 times, then right click on chat view and choose Clear. Chat log in a view will be cleared, again type something the form size stays the same as before clearing the log view. Change-Id: I8c057dbd4ed52e5d1efce7064d79b9f7244b3d32
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtWebKitChatView.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp
index 9aeef24..048fe99 100644
--- a/Swift/QtUI/QtWebKitChatView.cpp
+++ b/Swift/QtUI/QtWebKitChatView.cpp
@@ -89,60 +89,61 @@ QtWebKitChatView::QtWebKitChatView(QtChatWindow* window, UIEventStream* eventStr
webPage_->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
}
webView_->setPage(webPage_);
connect(webPage_, SIGNAL(selectionChanged()), SLOT(copySelectionToClipboard()));
viewReady_ = false;
isAtBottom_ = true;
resetView();
jsBridge = new QtChatWindowJSBridge();
addToJSEnvironment("chatwindow", jsBridge);
connect(jsBridge, SIGNAL(buttonClicked(QString,QString,QString,QString,QString,QString)), this, SLOT(handleHTMLButtonClicked(QString,QString,QString,QString,QString,QString)));
connect(jsBridge, SIGNAL(verticalScrollBarPositionChanged(double)), this, SLOT(handleVerticalScrollBarPositionChanged(double)));
}
QtWebKitChatView::~QtWebKitChatView() {
delete jsBridge;
}
void QtWebKitChatView::handleClearRequested() {
QMessageBox messageBox(this);
messageBox.setWindowTitle(tr("Clear log"));
messageBox.setText(tr("You are about to clear the contents of your chat log."));
messageBox.setInformativeText(tr("Are you sure?"));
messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
messageBox.setDefaultButton(QMessageBox::Yes);
int button = messageBox.exec();
if (button == QMessageBox::Yes) {
logCleared();
resetView();
+ resizeFont(fontSizeSteps_);
}
}
void QtWebKitChatView::handleKeyPressEvent(QKeyEvent* event) {
webView_->keyPressEvent(event);
}
void QtWebKitChatView::addMessageBottom(std::shared_ptr<ChatSnippet> snippet) {
if (viewReady_) {
addToDOM(snippet);
} else {
/* If this asserts, the previous queuing code was necessary and should be reinstated */
assert(false);
}
}
void QtWebKitChatView::addMessageTop(std::shared_ptr<ChatSnippet> /* snippet */) {
// TODO: Implement this in a sensible manner later.
SWIFT_LOG(error) << "Not yet implemented!" << std::endl;
}
void QtWebKitChatView::addToDOM(std::shared_ptr<ChatSnippet> snippet) {
//qDebug() << snippet->getContent();
rememberScrolledToBottom();
QWebElement insertElement = webPage_->mainFrame()->findFirstElement("#insert");
assert(!insertElement.isNull());
insertElement.prependOutside(snippet->getContent());
//qDebug() << "-----------------";