<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/126720/">https://git.reviewboard.kde.org/r/126720/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On January 11th, 2016, 6:35 p.m. UTC, <b>Marco Martin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/126720/diff/1/?file=430382#file430382line164" style="color: black; font-weight: bold; text-decoration: underline;">src/plasma/svg.cpp</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">SvgPrivate::SvgPrivate(Svg *svg)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">164</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="kt">void</span> <span class="n">SvgPrivate</span><span class="o">::</span><span class="n">updateCustomStyleCrc</span><span class="p">(){</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">coding style:
void SvgPrivate::updateCustomStyleCrc()
{</p></pre>
</blockquote>
<p>On January 11th, 2016, 10:03 p.m. UTC, <b>Nico Rodsevich</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I don't totally get why QVariantMap is that bad:
The idea with this first patch is to have initially set the whole customColors palette with the bare minimun necessary code (and memory), up to the little I know, QVariantMap does this perfectly by don't consuming memmory when nothing is in it and only saving strings when it has <strong style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">any number</strong> of rules. Maybe there is some functionality Qt provides that in my research went out of my sight, but can't think it woould be much better than 0-N rules with just saving strings</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">In addition, when reading QML code:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">PlasmaCore.SvgItem{
<span style="color: #008000; font-weight: bold">id: svgObject</span>
<span style="color: #008000; font-weight: bold">svg:</span> PlasmaCore.Svg{
<span style="color: #008000; font-weight: bold">customColorScheme:</span> {
<span style="color: #BA2121">"#rule1"</span><span style="color: #666666">:</span><span style="color: #BA2121">"color"</span>,
<span style="color: #BA2121">".rule2"</span><span style="color: #666666">:</span><span style="color: #BA2121">"color"</span>
}
}
}
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">seems pretty explanatory and when you gotta programatically change or add the colors you have the <strong style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">svgObject.svg.customColorRule("#colorX","color")</strong> function
>From the perspective of a QML programmer this is bearable enough and simplifies a lot the programming of rich UI plasmoids with little imperceptible processing or memory consumption, doesn't it?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Please note that I'm totally new to this world and there are pretty much obvious things that I don't know right now, I'm only trying to understand</em></p></pre>
</blockquote>
<p>On January 11th, 2016, 10:58 p.m. UTC, <b>Marco Martin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">if you have
PlasmaCore.SvgItem{
id: svgObject
svg: PlasmaCore.Svg{
customColorScheme: {
"#rule1":"color",
".rule2":"color"
}
}
}</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">then is possible to have
Rectangle {
color: svgObject.svg.customColorScheme[".rule2"]
}</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">and it will work, but property binding won't work, so changing the content of .rule2 won't update, this is usually considered a problem in a QML api (it will also produce a runtime warning)
If we go all this way, I would almost go all the way and have a simple string in an "additionalStyleSheet" property...</p></pre>
</blockquote>
<p>On January 12th, 2016, 1:03 a.m. UTC, <b>Nico Rodsevich</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Ooohhh now I get it! Thanks!
What about...</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">PlasmaCore.SvgItem{
<span style="color: #008000; font-weight: bold">id: svgObject</span>
<span style="color: #008000; font-weight: bold">svg:</span> PlasmaCore.Svg{
<span style="color: #008000; font-weight: bold">customColorScheme:</span> {
CustomColorRule{
<span style="color: #008000; font-weight: bold">id: rule1</span>
<span style="color: #008000; font-weight: bold">name:</span> <span style="color: #BA2121">"#rule1"</span>
<span style="color: #008000; font-weight: bold">color:</span> <span style="color: #BA2121">"red"</span>
}
CustomColorRule{
<span style="color: #008000; font-weight: bold">id: rule2</span>
<span style="color: #008000; font-weight: bold">name:</span> <span style="color: #BA2121">".rule2"</span>
<span style="color: #008000; font-weight: bold">color:</span> <span style="color: #BA2121">"#ABCDEF"</span>
}
}
}
}
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">??</p></pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">that would be quite complicated to manage from the c++ part and a bit memory expensice since would create a lot of objects..
and, only allow colors so wouldn't buy much more (the advantage of arbitrary stylesheets would be to be able to do other things as well, like hiding elements, alterng opacity etc, but here we are going quite in dangerous territory)</p></pre>
<br />
<p>- Marco</p>
<br />
<p>On January 11th, 2016, 9:37 p.m. UTC, Nico Rodsevich wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for Plasma, David Edmundson and Marco Martin.</div>
<div>By Nico Rodsevich.</div>
<p style="color: grey;"><i>Updated Jan. 11, 2016, 9:37 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-framework
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Enables to set rules that extends the #current-color-scheme CSS style of the Svg in order to change the Svg's items with currentColor fill to the specified in the customColors rules</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/plasma/private/svg_p.h <span style="color: grey">(1d1000d)</span></li>
<li>src/plasma/svg.h <span style="color: grey">(3a4ca1d)</span></li>
<li>src/plasma/svg.cpp <span style="color: grey">(28abd00)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/126720/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>