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:
@ -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)
|
||||
|
Reference in New Issue
Block a user