Review Request: Color scheme aware plasma theming

Aaron Seigo aseigo at kde.org
Mon Feb 18 18:45:37 CET 2008


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://mattr.info/r/154/#review146
-----------------------------------------------------------


needs a few things fixed up, but all pretty easy to do.


/trunk/KDE/kdebase/workspace/libs/plasma/svg.cpp
<http://mattr.info/r/154/#comment102>

    i wonder if this shouldn't be cached into a bool read once on setting the svg.



/trunk/KDE/kdebase/workspace/libs/plasma/svg.cpp
<http://mattr.info/r/154/#comment103>

    this is going to recreate every svg every time an event happens regardless of whether it needs to or not. obviously not great for performance. there are other ways to accomplish what you are trying to do (see below)



/trunk/KDE/kdebase/workspace/libs/plasma/svg.cpp
<http://mattr.info/r/154/#comment104>

    this clears the *entire* pixmap cache for the whole application. four lines above we remove this svg from the cache, so this line should be unnecessary in the first place.



/trunk/KDE/kdebase/workspace/libs/plasma/theme.cpp
<http://mattr.info/r/154/#comment105>

    i would suggest connecting to a different slot, for reasons i'll cover below



/trunk/KDE/kdebase/workspace/libs/plasma/theme.cpp
<http://mattr.info/r/154/#comment106>

    this signal is already emitted when the svg path changes, so all it really does here is create a second repaint.
    
    i'd suggest instead to not change anything at all in Plasma::Theme and instead put this in Plasma::Svg:
    
    if the colourization hint is found in the Svg, then connect to this KGlobalSettings signal. in the method it is connected to (colorsChanged?) and in that method do something like:
    
    d->removeFromCache();
    d->setImagePath(d->themed ? d->themePath : d->path);
    d->eraseRenderer();
    emit repaintNeeded();
    
    so much like what is in themeChanged(), but specific to the colour change needs.
    


- Aaron


On 2008-02-17 18:13:18, Andrew Lake wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://mattr.info/r/154/
> -----------------------------------------------------------
> 
> (Updated 2008-02-17 18:13:18)
> 
> 
> Review request for Plasma.
> 
> 
> Summary
> -------
> 
> This patch allows plasma themes to react to changes in the current color scheme. Note that theme authors must specifically add the "hint-apply-color-scheme" element to the svgs for the color to be applied.  This patch does not affect svgs that do not have this hint.  (Notice in the screenshots that the clock and the default theme are unaffected.) Theme authors may provide a "colors" file with their theme or omit it to use the current system colors (plasma already provided for this).
> 
> The screenshots show a proof of concept theme.  Couldn't find a way to attach it here.  Let me know what's the best way to make it available in case anyone wants to test it.
> 
> A few notes:
> - I picked the colorize effect from KIconEffect since it allows the theme author to define where, and how much, colors are applied (preserves shadows, etc.).  If this effect is available somewhere else I couldn't find it.
> - Some things I added to just get this to work (the QPixmapCache::clear() and the extra "emit changed()").
> 
> Hope this helps and once again that's so much for this cool stuff.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdebase/workspace/libs/plasma/svg.cpp
>   /trunk/KDE/kdebase/workspace/libs/plasma/theme.cpp
> 
> Diff: http://mattr.info/r/154/diff
> 
> 
> Testing
> -------
> 
> 
> Screenshots
> -----------
> 
> plasmawonton
>   http://mattr.info/r/154/s/10/
> plasmaobsidian
>   http://mattr.info/r/154/s/11/
> plasmanorway
>   http://mattr.info/r/154/s/12/
> plasmadefault
>   http://mattr.info/r/154/s/13/
> 
> 
> Thanks,
> 
> Andrew
> 
>



More information about the Panel-devel mailing list