Skip to content
Snippets Groups Projects
Commit b128f26f authored by Justin Kim's avatar Justin Kim
Browse files

roller: Remove static `update_glow` function


`lightwood_roller_set_glow_row` is already a public function and
it doesn't need to wrap an internal function, in terms of simplification.

Reviewed-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>
Signed-off-by: default avatarJustin Kim <justin.kim@collabora.com>
Differential Revision: https://phabricator.apertis.org/D5480
parent 39b7d879
No related branches found
No related tags found
No related merge requests found
......@@ -1510,42 +1510,6 @@ get_glow_row(LightwoodRoller *roller)
return -1;
}
static void
update_glow (LightwoodRoller *roller, gint row)
{
GSList *items, *iter;
ClutterActorBox *allocations;
gint i;
guint len;
ClutterActor *child_actor;
ClutterActor *glow_actor = NULL;
ROLLER_DEBUG("%s",__FUNCTION__);
items = lightwood_roller_get_actors (roller);
allocations = lightwood_roller_get_allocations (roller, -1, -1, -1, TRUE, &len);
if (row >= 0)
glow_actor = child_actor = lightwood_roller_get_actor_for_row (roller, row);
/* First unfocus for those items that share a shader at the class level */
for (iter = items, i = 0; iter; iter = iter->next, i++)
{
child_actor = (ClutterActor *) iter->data;
if (g_object_class_find_property (G_OBJECT_GET_CLASS (child_actor), "highlight") == NULL)
continue;
g_object_set (child_actor,
"highlight", (child_actor == glow_actor),
NULL);
}
g_slice_free1 (sizeof(ClutterActorBox) * g_slist_length (items),
allocations);
g_slist_free (items);
}
/**
* lightwood_roller_set_glow_row:
* @roller: A #LightwoodRoller
......@@ -1557,14 +1521,40 @@ update_glow (LightwoodRoller *roller, gint row)
* then roller item object can have :highlight. property defined.
*
*/
void
lightwood_roller_set_glow_row (LightwoodRoller *roller,
gint row)
{
update_glow(roller,row);
return;
GSList *items, *iter;
ClutterActorBox *allocations;
gint i;
guint len;
ClutterActor *child_actor;
ClutterActor *glow_actor = NULL;
ROLLER_DEBUG("%s",__FUNCTION__);
items = lightwood_roller_get_actors (roller);
allocations = lightwood_roller_get_allocations (roller, -1, -1, -1, TRUE, &len);
if (row >= 0)
glow_actor = child_actor = lightwood_roller_get_actor_for_row (roller, row);
/* First unfocus for those items that share a shader at the class level */
for (iter = items, i = 0; iter; iter = iter->next, i++)
{
child_actor = (ClutterActor *) iter->data;
if (g_object_class_find_property (G_OBJECT_GET_CLASS (child_actor), "highlight") == NULL)
continue;
g_object_set (child_actor,
"highlight", (child_actor == glow_actor),
NULL);
}
g_slice_free1 (sizeof (ClutterActorBox) * g_slist_length (items), allocations);
g_slist_free (items);
}
static gboolean
......@@ -1599,7 +1589,7 @@ event_cb (ClutterActor *actor,
if(row != -1)
{
if(priv->glow == TRUE)
update_glow(LIGHTWOOD_ROLLER (actor),row);
lightwood_roller_set_glow_row (LIGHTWOOD_ROLLER (actor), row);
g_debug ("ROLLER:ITEM_ACTIVATED");
g_signal_emit (actor, signals[ITEM_ACTIVATED], 0, row);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment