[St] Remove _st_actor_contains()
The function has been upstreamed as clutter_actor_contains() - with the switch to clutter-1.4 it is now available to the Shell, so it is no longer necessary to keep a copy in-tree. https://bugzilla.gnome.org/show_bug.cgi?id=626512
This commit is contained in:
parent
3fb7cce80f
commit
766b5b801c
@ -121,7 +121,7 @@ st_clickable_button_press_event (ClutterActor *actor,
|
|||||||
if (self->priv->held)
|
if (self->priv->held)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (!_st_actor_contains (actor, event->source))
|
if (!clutter_actor_contains (actor, event->source))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
self->priv->held = TRUE;
|
self->priv->held = TRUE;
|
||||||
@ -148,7 +148,7 @@ st_clickable_button_release_event (ClutterActor *actor,
|
|||||||
self->priv->held = FALSE;
|
self->priv->held = FALSE;
|
||||||
clutter_ungrab_pointer ();
|
clutter_ungrab_pointer ();
|
||||||
|
|
||||||
if (!_st_actor_contains (actor, event->source))
|
if (!clutter_actor_contains (actor, event->source))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
set_pressed (self, FALSE);
|
set_pressed (self, FALSE);
|
||||||
|
@ -584,7 +584,7 @@ st_entry_enter_event (ClutterActor *actor,
|
|||||||
{
|
{
|
||||||
StEntryPrivate *priv = ST_ENTRY_PRIV (actor);
|
StEntryPrivate *priv = ST_ENTRY_PRIV (actor);
|
||||||
|
|
||||||
if (_st_actor_contains (actor, event->source)
|
if (clutter_actor_contains (actor, event->source)
|
||||||
&& priv->hint && priv->hint_visible)
|
&& priv->hint && priv->hint_visible)
|
||||||
{
|
{
|
||||||
st_widget_set_hover (ST_WIDGET (actor), TRUE);
|
st_widget_set_hover (ST_WIDGET (actor), TRUE);
|
||||||
@ -597,7 +597,7 @@ static gboolean
|
|||||||
st_entry_leave_event (ClutterActor *actor,
|
st_entry_leave_event (ClutterActor *actor,
|
||||||
ClutterCrossingEvent *event)
|
ClutterCrossingEvent *event)
|
||||||
{
|
{
|
||||||
if (!_st_actor_contains (actor, event->related))
|
if (!clutter_actor_contains (actor, event->related))
|
||||||
st_widget_set_hover (ST_WIDGET (actor), FALSE);
|
st_widget_set_hover (ST_WIDGET (actor), FALSE);
|
||||||
|
|
||||||
return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->leave_event (actor, event);
|
return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->leave_event (actor, event);
|
||||||
|
@ -320,12 +320,3 @@ _st_set_text_from_style (ClutterText *text,
|
|||||||
clutter_text_set_line_alignment (text, (PangoAlignment) align);
|
clutter_text_set_line_alignment (text, (PangoAlignment) align);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
_st_actor_contains (ClutterActor *actor,
|
|
||||||
ClutterActor *child)
|
|
||||||
{
|
|
||||||
while (child != NULL && child != actor)
|
|
||||||
child = clutter_actor_get_parent (child);
|
|
||||||
return child != NULL;
|
|
||||||
}
|
|
||||||
|
@ -72,7 +72,4 @@ void _st_allocate_fill (StWidget *parent,
|
|||||||
void _st_set_text_from_style (ClutterText *text,
|
void _st_set_text_from_style (ClutterText *text,
|
||||||
StThemeNode *theme_node);
|
StThemeNode *theme_node);
|
||||||
|
|
||||||
gboolean _st_actor_contains (ClutterActor *actor,
|
|
||||||
ClutterActor *child);
|
|
||||||
|
|
||||||
#endif /* __ST_PRIVATE_H__ */
|
#endif /* __ST_PRIVATE_H__ */
|
||||||
|
@ -568,7 +568,7 @@ st_widget_enter (ClutterActor *actor,
|
|||||||
|
|
||||||
if (priv->track_hover)
|
if (priv->track_hover)
|
||||||
{
|
{
|
||||||
if (_st_actor_contains (actor, event->source))
|
if (clutter_actor_contains (actor, event->source))
|
||||||
st_widget_set_hover (ST_WIDGET (actor), TRUE);
|
st_widget_set_hover (ST_WIDGET (actor), TRUE);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -594,7 +594,7 @@ st_widget_leave (ClutterActor *actor,
|
|||||||
|
|
||||||
if (priv->track_hover)
|
if (priv->track_hover)
|
||||||
{
|
{
|
||||||
if (!_st_actor_contains (actor, event->related))
|
if (!clutter_actor_contains (actor, event->related))
|
||||||
st_widget_set_hover (ST_WIDGET (actor), FALSE);
|
st_widget_set_hover (ST_WIDGET (actor), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1589,7 +1589,10 @@ st_widget_sync_hover (StWidget *widget)
|
|||||||
pointer = clutter_device_manager_get_core_device (device_manager,
|
pointer = clutter_device_manager_get_core_device (device_manager,
|
||||||
CLUTTER_POINTER_DEVICE);
|
CLUTTER_POINTER_DEVICE);
|
||||||
pointer_actor = clutter_input_device_get_pointer_actor (pointer);
|
pointer_actor = clutter_input_device_get_pointer_actor (pointer);
|
||||||
st_widget_set_hover (widget, _st_actor_contains (CLUTTER_ACTOR (widget), pointer_actor));
|
if (pointer_actor)
|
||||||
|
st_widget_set_hover (widget, clutter_actor_contains (CLUTTER_ACTOR (widget), pointer_actor));
|
||||||
|
else
|
||||||
|
st_widget_set_hover (widget, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user