summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-06-14 21:28:58 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-06-15 07:44:48 (GMT)
commit5a1bdf2f6a4842176be5938f8db5cb9d151aceb5 (patch)
tree338090bf71a0a5836ac1210e8433694479567d50 /Swift/QtUI/QtChatView.cpp
parentb4a24233debf8ee7e5005aa787ff48c52abe7df6 (diff)
downloadswift-contrib-5a1bdf2f6a4842176be5938f8db5cb9d151aceb5.zip
swift-contrib-5a1bdf2f6a4842176be5938f8db5cb9d151aceb5.tar.bz2
Preliminary emoticon work.
Parsing and toggling support for emoticons. No emoticons are included so this won't do anything yet.
Diffstat (limited to 'Swift/QtUI/QtChatView.cpp')
-rw-r--r--Swift/QtUI/QtChatView.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp
index 54bce09..a55161f 100644
--- a/Swift/QtUI/QtChatView.cpp
+++ b/Swift/QtUI/QtChatView.cpp
@@ -183,6 +183,21 @@ void QtChatView::replaceMessage(const QString& newMessage, const QString& id, co
}
}
+void QtChatView::showEmoticons(bool show) {
+ {
+ const QWebElementCollection spans = document_.findAll("span.swift_emoticon_image");
+ foreach (QWebElement span, spans) {
+ span.setStyleProperty("display", show ? "inline" : "none");
+ }
+ }
+ {
+ const QWebElementCollection spans = document_.findAll("span.swift_emoticon_text");
+ foreach (QWebElement span, spans) {
+ span.setStyleProperty("display", show ? "none" : "inline");
+ }
+ }
+}
+
void QtChatView::copySelectionToClipboard() {
if (!webPage_->selectedText().isEmpty()) {
webPage_->triggerAction(QWebPage::Copy);