NOTE: this information only applies to pre-v2 layouts
The configuration placed in a manifest is only applied to the windows of that specific application (as in, windows with the same UUID as the UUID in the 'startup_app' section of the manifest).
"services": [
{
"name": "layouts",
"config": {
"features": { "tab": false }
}
}
]
If that application spawns a child application, that configuration will not be applied because the windows of the child application will have a different UUID. However, the layouts configuration mechanism has a concept of rules, which allow greater control over which windows a snippet of config data is applied to. These rules can also be used for configuring child applications. Rules can be at a window or application level, and can target a specific window/application, or use regex patterns to target multiple windows/applications at once.
In a scenario where an "App-Parent" app were to spawn applications "App-Child-1" and "App-Child-2", tabbing could be disabled in all three applications like so:
{
"startup_app": {
"uuid": "App-Parent",
. . .
},
"services": {
"name": "layouts",
"config": {
// This config is applied only to App-Parent, since this is the App-Parent manifest
"features": {"tab": false},
// Also declare a rule, so we can configure the child applications
"rules": [{
// A rule's scope is used to determine which entities (windows/applications) the rule will be applied to
"scope": {
// This is an application-scope rule, meaning it will affect all windows of any application that matches the UUID filter
"level": "application",
// The UUID property can be a string, to apply the rule to one specific application, or a regex (specified in a JSON format) as in this example.
"uuid": {"expression": "App-Child-\d+"}
},
// For any entity that matches the scope above, this is the config that will be applied to it. In this case, it's the same config as is applied to App-Parent
"config": {
"features": {"tab": false}
}
}]
}
}
}
Comments
0 comments
Article is closed for comments.