Plasma::Stylesheet?

Marco Martin notmart at gmail.com
Thu May 6 15:27:54 CEST 2010


On Thursday 06 May 2010, Sebastian Kügler wrote:
> Hey,
> 
> I'd like to get in my work on stylesheet support in Plasma, before the
> feature freeze on May, 11th.
> 
> Right now, Stylesheet is a standalone class that give you a QString
> stylesheet() that uses Plasma::Theme's colouring and font sizing. This is
> useful basically whenever you want to use non-trivial HTML in your applet
> (or other Plasma code).
> 
> During Tokamak4, Aaron and I sat together to discuss how we want this in
> Plasma and we came to the preliminary conclusion that it'd best be added
> as a method to Plasma::Theme, so you basically get QString
> Plasma::Theme::stylesheet().
> 
> Thinking about this, it might be too limited, as I'd like to support custom
> stylesheets as well, basically what I have in mind is:

a way would be with simple string replacement so QStrig 
Plasma::Theme::processStyleSheet(QString)

the input would be like "color: #plasma-textcolor; background: #plasma-
buttoncolor" then those #plasma-foo would be replaced with proper colors.
then on the slot reacting to themeChanged you do again webwidget-
>setStyleSheet(Plasma::Theme::processStyleSheet(rawString));

it's not super pretty, but the class works in this way as well, is just more 
contained in a single object.

Cheers,
Marco Martin


More information about the Plasma-devel mailing list