Now Listen plasmoid
Alex Merry
kde at randomguy3.me.uk
Wed Mar 20 13:51:33 UTC 2013
On 20/03/13 13:00, Aaron J. Seigo wrote:
> On Tuesday, March 19, 2013 23:44:37 Alex Merry wrote:
>> I investigated this, and there does not seem to be an easy way to do it
>> with QML plasmoids. If you just ask for something "from the theme", you
>> can't provide a default in the plasmoid. To get something from the
>> plasmoid, you have to explicitly get it from there, and it can't then be
>> overridden in the theme.
>
> If you use an SVG item, it will look first in the plasmoid, then in the theme.
> in general, you should not need to request the path of the svg specifically
> from a Theme item, but simply set the imagePath property appropriately.
>
Well, maybe that's how it should work, but the "plasmoid lookup" code
for SVGs is kinda broken. It only ever worked if the Plasma::SVG was a
direct child of the Applet object (which you can't do in QML), and I'm
pretty sure it doesn't work at all now (there are two bits of code that
do the "theme lookup", and the one that actually gets called first - via
elementRect, IIRC - doesn't look in the plasmoid).
I had a look at fixing this, but couldn't determine a sensible way to
find out what the plasmoid was from Plasma::SVG in the case of QML
plasmoids. Simply walking up the QObject parent tree doesn't work.
As a result, I end up using plasmoid.file to get the correct path to the
SVG file. I don't *think* that looks at the theme, though. If it does,
it doesn't appear to allow the theme to override the plasmoid file.
Alex
More information about the Plasma-devel
mailing list