Commit a01bc353 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Avoid to recreate KColorScheme when read another email

parent 23c08bb2
Pipeline #129391 passed with stage
in 14 minutes and 41 seconds
......@@ -39,11 +39,13 @@ QString EnterpriseHeaderStyle::format(KMime::Message *message) const
// colors depend on if it is encapsulated or not
QColor fontColor(Qt::white);
QString linkColor = QStringLiteral("class =\"white\"");
const QColor activeColor = KColorScheme(QPalette::Active, KColorScheme::Selection).background().color();
QColor activeColorDark = activeColor.darker(130);
if (!mActiveColor.isValid()) {
mActiveColor = KColorScheme(QPalette::Active, KColorScheme::Selection).background().color();
}
QColor activeColorDark = mActiveColor.darker(130);
// reverse colors for encapsulated
if (!isTopLevel()) {
activeColorDark = activeColor.darker(50);
activeColorDark = mActiveColor.darker(50);
fontColor = QColor(Qt::black);
linkColor = QStringLiteral("class =\"black\"");
}
......
......@@ -22,9 +22,10 @@ public:
const char *name() const override;
QString format(KMime::Message *message) const override;
Q_REQUIRED_RESULT QString format(KMime::Message *message) const override;
private:
mutable QColor mActiveColor;
MessageViewer::HeaderStyleUtil mHeaderStyleUtil;
};
}
......
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