actor: Clean up ::show and ::hide class handlers

The main body of the function should not live inside an 'if' block.
This commit is contained in:
Emmanuele Bassi 2013-03-08 15:24:50 +00:00
parent c11c875762
commit 900015a4eb

View File

@ -1612,15 +1612,16 @@ clutter_actor_unmap (ClutterActor *self)
static void
clutter_actor_real_show (ClutterActor *self)
{
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
{
ClutterActorPrivate *priv = self->priv;
if (CLUTTER_ACTOR_IS_VISIBLE (self))
return;
CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_VISIBLE);
/* we notify on the "visible" flag in the clutter_actor_show()
* wrapper so the entire show signal emission completes first
* (?)
* wrapper so the entire show signal emission completes first,
* and the branch of the scene graph is in a stable state
*/
clutter_actor_update_map_state (self, MAP_STATE_CHECK);
@ -1638,9 +1639,9 @@ clutter_actor_real_show (ClutterActor *self)
priv->needs_width_request = FALSE;
priv->needs_height_request = FALSE;
priv->needs_allocation = FALSE;
clutter_actor_queue_relayout (self);
}
}
}
static inline void
@ -1747,15 +1748,16 @@ clutter_actor_show_all (ClutterActor *self)
static void
clutter_actor_real_hide (ClutterActor *self)
{
if (CLUTTER_ACTOR_IS_VISIBLE (self))
{
ClutterActorPrivate *priv = self->priv;
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
return;
CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_VISIBLE);
/* we notify on the "visible" flag in the clutter_actor_hide()
* wrapper so the entire hide signal emission completes first
* (?)
* wrapper so the entire hide signal emission completes first,
* and the branch of the scene graph is in a stable state
*/
clutter_actor_update_map_state (self, MAP_STATE_CHECK);
@ -1765,7 +1767,6 @@ clutter_actor_real_hide (ClutterActor *self)
if (priv->parent != NULL &&
(!(priv->parent->flags & CLUTTER_ACTOR_NO_LAYOUT)))
clutter_actor_queue_relayout (priv->parent);
}
}
/**