Commit c7b8bffe authored by Laurent Montel's avatar Laurent Montel 😁

Show emoticon in these themes

CCBUG: 369555
parent 7bce519f
......@@ -34,7 +34,7 @@
#include "briefheaderstyle.h"
#include "messageviewer/headerstyle.h"
#include "messageviewer/headerstyle_util.h"
#include "messageviewer/messageviewersettings.h"
#include "messageviewer/headerstrategy.h"
#include <MessageCore/StringUtil>
......@@ -78,10 +78,15 @@ QString BriefHeaderStyle::format(KMime::Message *message) const
QString headerStr = QLatin1String("<div class=\"header\" dir=\"") + dir + QLatin1String("\">\n");
if (strategy->showHeader(QStringLiteral("subject"))) {
KTextToHTML::Options flags = KTextToHTML::PreserveSpaces;
if (MessageViewer::MessageViewerSettings::self()->showEmoticons()) {
flags |= KTextToHTML::ReplaceSmileys;
}
headerStr += QLatin1String("<div dir=\"") + subjectDir + QLatin1String("\">\n") +
QLatin1String("<b style=\"font-size:130%\">");
headerStr += mHeaderStyleUtil.subjectString(message) + QLatin1String("</b></div>\n");
headerStr += mHeaderStyleUtil.subjectString(message, flags) + QLatin1String("</b></div>\n");
}
QStringList headerParts;
......
......@@ -19,6 +19,7 @@
#include "enterpriseheaderstyle.h"
#include "messageviewer/headerstyle_util.h"
#include "messageviewer/messageviewersettings.h"
#include "messageviewer/headerstrategy.h"
......@@ -99,11 +100,16 @@ QString EnterpriseHeaderStyle::format(KMime::Message *message) const
// subject
if (strategy->showHeader(QStringLiteral("subject"))) {
KTextToHTML::Options flags = KTextToHTML::PreserveSpaces;
if (MessageViewer::MessageViewerSettings::self()->showEmoticons()) {
flags |= KTextToHTML::ReplaceSmileys;
}
headerStr +=
QLatin1String(" <tr> \n"
" <td style=\"font-size: 0.5em; text-align: right; padding-left: 5px; padding-right: 24px; ") + borderSettings + QLatin1String("\"></td> \n"
" <td style=\"font-weight: bolder; font-size: 120%; padding-right: 91px; ") + borderSettings + QLatin1String("\">");
headerStr += mHeaderStyleUtil.subjectString(message) + QLatin1String("</td> \n"
headerStr += mHeaderStyleUtil.subjectString(message, flags) + QLatin1String("</td> \n"
" </tr> \n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment