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

@ -20,28 +20,6 @@ G_DEFINE_TYPE (ShellStack,
shell_stack,
ST_TYPE_CONTAINER);
static void
shell_stack_paint (ClutterActor *actor)
{
CLUTTER_ACTOR_CLASS (shell_stack_parent_class)->paint (actor);
clutter_container_foreach (CLUTTER_CONTAINER (actor),
CLUTTER_CALLBACK (clutter_actor_paint),
NULL);
}
static void
shell_stack_pick (ClutterActor *actor,
const ClutterColor *pick)
{
/* Chain up so we get a bounding box painted (if we are reactive) */
CLUTTER_ACTOR_CLASS (shell_stack_parent_class)->pick (actor, pick);
clutter_container_foreach (CLUTTER_CONTAINER (actor),
CLUTTER_CALLBACK (clutter_actor_paint),
NULL);
}
static void
shell_stack_allocate (ClutterActor *self,
const ClutterActorBox *box,
@ -206,8 +184,6 @@ shell_stack_class_init (ShellStackClass *klass)
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
actor_class->paint = shell_stack_paint;
actor_class->pick = shell_stack_pick;
actor_class->get_preferred_width = shell_stack_get_preferred_width;
actor_class->get_preferred_height = shell_stack_get_preferred_height;
actor_class->allocate = shell_stack_allocate;