st-widget: Add a proper paint, add st_widget_paint_background

Since we want to paint children by default in StWidget, we need to
provide a way for custom subclasses to paint their CSS backgrounds
without painting children... introducing st_widget_paint_background.

Additionally, remove any custom paint/pick handlers added by subclasses
of StWidget that just painted their children. This will cause double
painting if left alone.

This also removes the hacky things that some subclasses of StBin did
to prevent their one child to be painted by StBin.

https://bugzilla.gnome.org/show_bug.cgi?id=670034
This commit is contained in:
Jasper St. Pierre
2012-02-13 16:41:29 -05:00
parent a9f728d2a7
commit 64b2c5d1b4
14 changed files with 35 additions and 199 deletions

View File

@ -266,10 +266,10 @@ st_scroll_view_paint (ClutterActor *actor)
{
StScrollViewPrivate *priv = ST_SCROLL_VIEW (actor)->priv;
/* StBin will paint the child */
CLUTTER_ACTOR_CLASS (st_scroll_view_parent_class)->paint (actor);
st_widget_paint_background (ST_WIDGET (actor));
/* paint our custom children */
if (priv->child)
clutter_actor_paint (priv->child);
if (priv->hscrollbar_visible)
clutter_actor_paint (priv->hscroll);
if (priv->vscrollbar_visible)
@ -285,7 +285,8 @@ st_scroll_view_pick (ClutterActor *actor,
/* Chain up so we get a bounding box pained (if we are reactive) */
CLUTTER_ACTOR_CLASS (st_scroll_view_parent_class)->pick (actor, color);
/* paint our custom children */
if (priv->child)
clutter_actor_paint (priv->child);
if (priv->hscrollbar_visible)
clutter_actor_paint (priv->hscroll);
if (priv->vscrollbar_visible)