script: Support layout manager properties
Layout properties work similarly to child properties, with the added headache that they require the 3-tuple: ( layout manager, container, actor ) to be valid in order to be inspected, parsed and applied. This means using the newly added back-pointer from the container to the layout manager and then rejigging a bit how the ScriptParser handles the unresolved properties. Similarly to the child properties, which use the "child::" prefix, the layout manager properties use the "layout::" prefix and are defined with the child of a container holding a layout manager.
This commit is contained in:
@@ -13,6 +13,7 @@ json_files = \
|
||||
test-animator-2.json \
|
||||
test-animator-3.json \
|
||||
test-state-1.json \
|
||||
test-script-layout-property.json \
|
||||
$(NULL)
|
||||
|
||||
png_files = \
|
||||
|
16
tests/data/test-script-layout-property.json
Normal file
16
tests/data/test-script-layout-property.json
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{ "id" : "manager", "type" : "ClutterBoxLayout" },
|
||||
|
||||
{
|
||||
"id" : "container", "type" : "ClutterBox",
|
||||
"layout-manager" : "manager",
|
||||
"children" : [
|
||||
{
|
||||
"id" : "actor", "type" : "ClutterRectangle",
|
||||
"layout::x-fill" : true,
|
||||
"layout::y-align" : "center",
|
||||
"layout::expand" : true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user