diff --git a/examples/layout-manager.c b/examples/layout-manager.c index 2f3dec64d..347a96a09 100644 --- a/examples/layout-manager.c +++ b/examples/layout-manager.c @@ -333,6 +333,30 @@ multi_layout_set_spacing (MultiLayout *self, #define PADDING 12.0 #define BOX_SIZE (RECT_SIZE * (N_RECTS / N_ROWS) + PADDING * (N_RECTS / N_ROWS - 1)) +static gboolean +on_enter (ClutterActor *rect, + ClutterEvent *event) +{ + clutter_actor_save_easing_state (rect); + clutter_actor_set_scale_with_gravity (rect, 1.2, 1.2, + CLUTTER_GRAVITY_CENTER); + clutter_actor_restore_easing_state (rect); + + return CLUTTER_EVENT_STOP; +} + +static gboolean +on_leave (ClutterActor *rect, + ClutterEvent *event) +{ + clutter_actor_save_easing_state (rect); + clutter_actor_set_scale_with_gravity (rect, 1.0, 1.0, + CLUTTER_GRAVITY_CENTER); + clutter_actor_restore_easing_state (rect); + + return CLUTTER_EVENT_STOP; +} + static gboolean on_key_press (ClutterActor *stage, ClutterEvent *event, @@ -407,7 +431,11 @@ main (int argc, char *argv[]) clutter_actor_set_size (rect, RECT_SIZE, RECT_SIZE); clutter_actor_set_background_color (rect, &color); + clutter_actor_set_reactive (rect, TRUE); clutter_actor_add_child (box, rect); + + g_signal_connect (rect, "enter-event", G_CALLBACK (on_enter), NULL); + g_signal_connect (rect, "leave-event", G_CALLBACK (on_leave), NULL); } label = clutter_text_new ();