LStateSet Struct
Public Members
| LConditions | conditions |
| LAttributeNodes | attributes |
| LGroupSets | group_sets |
Detailed Description
A state set applies one set of conditions to a block of attributes and/or group sets. Each expression in the block is that attribute's state value under those conditions, so the attributes can't declare inline states of their own.
@Narrow: // conditions = {"Narrow"}
Layout. // attributes = {
Direction: "Row" // { declaration = {
(Align,Justify): "Center" // group = {{"Size"}}
Size.Width: 0 // item = {{"Width"}} }
Corner Radii. // expression -> value -> number = 0 } }
Top (Left,Right): 20 // group_sets = {
Bottom Right: 0 // { declaration = {
// group = {{"Layout"}} }
// attributes = {
// { declaration = {
// item = {{"Direction"}} }
// expression -> value -> string = "Row" },
// { declaration = {
// item = {{"Align","Justify"}} }
// expression -> value -> string = "Center" }
// }
// },
// { declaration = {
// group = {{"Corner"}, {"Radii"}} }
// attributes = {
// { declaration = {
// item = {{"Top"}, {"Left","Right"}} }
// expression -> value -> number = 20 },
// { declaration = {
// item = {{"Bottom"}, {"Right"}} }
// expression -> value -> number = 0 }
// }
// }
// }
Without a state set, the same states are declared inline, beside each
attribute's main expression. This works, but the @Narrow values end up
scattered across the attributes; a state set keeps them together in one block.
Layout.
Direction: "Column" @Narrow: "Row"
Align: "Stretch" @Narrow: "Center"
Justify: "Start" @Narrow: "Center"
Size.Width: 200 @Narrow: 0
Corner Radii.
Top Left: 0 @Narrow: 20
Top Right: 5 @Narrow: 20
Bottom Left: 0
Bottom Right: 5 @Narrow: 0
Member Variable Documentation
LConditions conditions
Conditions the set's attributes apply under
LAttributeNodes attributes
Attributes that gain the state
LGroupSets group_sets
Group sets whose attributes gain the state