text: Implement the ::has_overlaps virtual

Since ClutterText has overlapping primitives when selecting, or a
visible cursor, then we need to report that to Clutter, to avoid
bleeding colors through when a Text actor is non-fully opaque.
This commit is contained in:
Emmanuele Bassi 2011-05-13 14:17:39 +01:00
parent 94c9c07509
commit 729e9985c1

View File

@ -2117,6 +2117,16 @@ clutter_text_allocate (ClutterActor *self,
parent_class->allocate (self, box, flags);
}
static gboolean
clutter_text_has_overlaps (ClutterActor *self)
{
ClutterTextPrivate *priv = CLUTTER_TEXT (self)->priv;
return priv->editable ||
priv->selectable ||
priv->cursor_visible;
}
static void
clutter_text_key_focus_in (ClutterActor *actor)
{
@ -2587,6 +2597,7 @@ clutter_text_class_init (ClutterTextClass *klass)
actor_class->motion_event = clutter_text_motion;
actor_class->key_focus_in = clutter_text_key_focus_in;
actor_class->key_focus_out = clutter_text_key_focus_out;
actor_class->has_overlaps = clutter_text_has_overlaps;
/**
* ClutterText:font-name: