summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-03-25 16:13:53 (GMT)
committerTobias Markmann <tm@ayena.de>2016-03-29 07:36:36 (GMT)
commitc26314684cd4e6140e5ea882285c2076505bd53d (patch)
tree9d31b6bfaced4a01aff8069096e2c9bb28efad43 /Swift/QtUI/QtChatTheme.cpp
parentdaf513a6567100322d3c51733ea0c449ca6adb1b (diff)
downloadswift-c26314684cd4e6140e5ea882285c2076505bd53d.zip
swift-c26314684cd4e6140e5ea882285c2076505bd53d.tar.bz2
Replace chat view theme with one based on the new design
This also removes the old chat theme resources and some code in QtWebKitChatView that was required for compatibility to Adium-style themes. The new code uses a CSS style in the header to change the font size and does not iterate the whole DOM tree itself anymore. Added new resources for failed and successful asks. Test-Information: Tested MUCs, PMs, message correction and file-transfers with the new chat theme. Change-Id: If922a972c658189444e60a7b00e5e5e96661620d
Diffstat (limited to 'Swift/QtUI/QtChatTheme.cpp')
-rw-r--r--Swift/QtUI/QtChatTheme.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/Swift/QtUI/QtChatTheme.cpp b/Swift/QtUI/QtChatTheme.cpp
index 5a9bc44..a7628d9 100644
--- a/Swift/QtUI/QtChatTheme.cpp
+++ b/Swift/QtUI/QtChatTheme.cpp
@@ -1,20 +1,19 @@
/*
- * Copyright (c) 2010 Isode Limited..
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
-#include "QtChatTheme.h"
+#include <Swift/QtUI/QtChatTheme.h>
#include <QFile>
-#include <qdebug.h>
namespace Swift {
/**
* Load Adium themes, as http://trac.adium.im/wiki/CreatingMessageStyles
*/
-QtChatTheme::QtChatTheme(const QString& themePath) : qrc_(themePath.isEmpty()), themePath_(qrc_ ? ":/themes/Default/" : themePath + "/Contents/Resources/") {
+QtChatTheme::QtChatTheme(const QString& themePath) : qrc_(themePath[0] == ':'), themePath_(qrc_ ? themePath : themePath + "/Contents/Resources/") {
QString fileNames[EndMarker];
fileNames[Header] = "Header.html";
fileNames[Footer] = "Footer.html";
@@ -32,6 +31,7 @@ QtChatTheme::QtChatTheme(const QString& themePath) : qrc_(themePath.isEmpty()),
fileNames[OutgoingNextContext] = "Outgoing/NextContext.html";
fileNames[Template] = "Template.html";
fileNames[MainCSS] = "main.css";
+ fileNames[Unread] = "Unread.html";
fileNames[TemplateDefault] = ":/themes/Template.html";
for (int i = 0; i < EndMarker; i++) {
QString source;
@@ -64,4 +64,8 @@ QString QtChatTheme::getBase() const {
return qrc_ ? "qrc" + themePath_ : "file://" + themePath_;
}
+QString QtChatTheme::getUnread() const {
+ return fileContents_[Unread].isEmpty() ? "<hr/>" : fileContents_[Unread];
+}
+
}