Review Request: Color scheme aware plasma theming

Andrew Lake jamboarder at yahoo.com
Thu Feb 21 21:03:04 CET 2008



> On 2008-02-18 11:45:37, Aaron Seigo wrote:
> > needs a few things fixed up, but all pretty easy to do.

After taking a few days to pay the bills by working at my real job, took some time to think about this change.  An updated diff is attached.

I realized that there's really two things going on here:
1. Getting the svg to repaint using the current plasma theme colors based on the presence of the required hint. This is done and the revision 2 diff should do that.
2. Getting plasma applets, etc. to update if the KDE color scheme changes.  The only time we would ever want this to occur is if no "colors" file was supplied with the theme, since that's the only time plasma is using the KDE system colors.  This is not yet quite done.  Plasma::Theme already uses the system colors if no "colors" file is supplied.  Plasma::Applets do not currently repaint on a system color change.

The result is that with the current diff, the svgs don't repaint until the Applet otherwise decides it needs to repaint (mouseover, click or some other signal).  So here's what I propose:  A new bool in Plasma::Theme to keep track of whether theme is using the system color scheme or the color scheme supplied with the theme. A colorsChanged() slot in applets that will update() when the system color changes.  The slot would only be connected if the new theme bool says it's using system colors.

If this sounds reasonable I'll update the diff with the changes for review.  I can also submit that as a separate review if you prefer since the svg part is basically done.


- Andrew


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


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.h
>   /trunk/KDE/kdebase/workspace/libs/plasma/svg.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