Commit 1ae77aa4 authored by Volker Krause's avatar Volker Krause
Browse files

Don't render pkpass files that don't specify all colors as black on black

parent fc4c1c88
......@@ -120,9 +120,15 @@ public:
}
// Grantlee can't handle QColor...
pass->setProperty("foregroundColorName", pass->foregroundColor().name());
pass->setProperty("backgroundColorName", pass->backgroundColor().name());
pass->setProperty("labelColorName", pass->labelColor().name());
if (pass->foregroundColor().isValid()) {
pass->setProperty("foregroundColorName", pass->foregroundColor().name());
}
if (pass->backgroundColor().isValid()) {
pass->setProperty("backgroundColorName", pass->backgroundColor().name());
}
if (pass->labelColor().isValid()) {
pass->setProperty("labelColorName", pass->labelColor().name());
}
auto c = MessageViewer::MessagePartRendererManager::self()->createContext();
c.insert(QStringLiteral("block"), mp.data());
......
......@@ -2,13 +2,17 @@
<div id="attachmentDiv{{block.attachmentIndex}}">
<div style="
background-color: {{ pass.backgroundColorName }};
{% if pass.backgroundColorName %}
background-color: {{ pass.backgroundColorName }};
{% endif %}
{% if pass.backgroundUrl %}
background-image: url('{{ pass.backgroundUrl }}');
background-repeat: no-repeat;
background-position: center top;
{% endif %}
color: {{ pass.foregroundColorName }};
{% if pass.foregroundColorName %}
color: {{ pass.foregroundColorName }};
{% endif %}
padding:12px;
margin-left: auto;
margin-right: auto;
......
Supports Markdown
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