mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 16:40:41 -05:00
d4190cbf8c
Extracted the animation into its own JSON definition, then create a new script and get the animation each time a rectangle is clicked. Removes the need to reparent onto the background and copy property values to the rectangle after the animation, and generally much cleaner.
54 lines
1.1 KiB
JSON
54 lines
1.1 KiB
JSON
[
|
|
{
|
|
"type" : "ClutterStage",
|
|
"id" : "stage",
|
|
"width" : 550,
|
|
"height" : 400,
|
|
"color" : "#333355ff",
|
|
|
|
"signals" : [
|
|
{ "name" : "destroy", "handler" : "clutter_main_quit" }
|
|
],
|
|
|
|
"children" : [
|
|
|
|
{
|
|
"type" : "ClutterRectangle",
|
|
"id" : "rect1",
|
|
"color" : "red",
|
|
"width" : 50,
|
|
"height" : 50,
|
|
"reactive" : true,
|
|
"signals" : [
|
|
{ "name" : "button-press-event", "handler" : "foo_button_pressed_cb" }
|
|
]
|
|
},
|
|
|
|
{
|
|
"type" : "ClutterRectangle",
|
|
"id" : "rect2",
|
|
"color" : "blue",
|
|
"width" : 50,
|
|
"height" : 50,
|
|
"reactive" : true,
|
|
"signals" : [
|
|
{ "name" : "button-press-event", "handler" : "foo_button_pressed_cb" }
|
|
]
|
|
},
|
|
|
|
{
|
|
"type" : "ClutterRectangle",
|
|
"id" : "rect3",
|
|
"color" : "green",
|
|
"width" : 50,
|
|
"height" : 50,
|
|
"reactive" : true,
|
|
"signals" : [
|
|
{ "name" : "button-press-event", "handler" : "foo_button_pressed_cb" }
|
|
]
|
|
}
|
|
|
|
]
|
|
}
|
|
]
|