Stylesheets and plasma widgets

Marco Martin notmart at gmail.com
Fri Sep 11 19:31:44 CEST 2009


On Friday 11 September 2009, Aaron J. Seigo wrote:
> On September 11, 2009, Marco Martin wrote:
> > On Friday 11 September 2009, Aaron J. Seigo wrote:
> > > On September 10, 2009, alan moore wrote:
> > > > Thanks; I tried this, but it didn't work (or else I'm doing it
> > > > wrong).
> > >
> > > looking at Plasma::PushButton, it doesn't allow setting the font
> > > directly. it uses the theme's font. it should probably not do so if a
> > > font is set (e.g. receives a FontChange event).. so some work needed in
> > > libplasma
> >
> > yeah, i'm not too happy about font and colors management in plasma..
> > for fonts, now we have:
> >
> > -Plasma::Theme::font(type)
> > -nativeWidget()->font()
> > -QGraphicsWidget::font();
>
> for our widgets that paint their own UI, e.g. pushbuttons, they should
> probably default to Plasma::Theme::font (which itself defaults back to the
> desktop defaults) and use QGraphicsWidget::font() if it has been explicitly
> set. nativeWidget()->font() can probably be ignored unless we're painting
> "native" style.
>
> what do you think?

so:
-use the plasma::teme::font
-at the first fontChange event set a bool and start to use 
QGraphicsWidget::font() instead after that

will do a first patch for the pushbutton and then start to fix the oher 
widgets..
but the ones thatreally have to use the proxywidget to paint, like the ones 
that have to layout text there wouldn't be much we can do about (maybe syncing 
the nativewidget font with the plasma theme one?)

> > now, i'm not sure if QGraphicsProxyWidget::font() is syncronized with
> > nativeWidget()->font(),
>
> afaik it is not.
>
> > but it should be used the one from plasma::teme
> >  unless a font is set, but is it possible at all to know if a non default
> >  font was set?
>
> probably by watching for FontChanged events. see the docu for
> QGraphicsWidget::setFont


-- 
Marco Martin


More information about the Plasma-devel mailing list