RowScope

sealed interface RowScope

The receiver of a Row's content, through which a child declares its own placement in that row.

Children are written plainly; what a child declares here rides along on its modifier:

Row {
Label(text = "Status")
FlowPanel(modifier = SwingModifier.weight(1f)) { Details() }
Button(text = "Close", onClick = ::close, modifier = SwingModifier.align(Alignment.Bottom))
}

Functions

Link copied to clipboard

Places the child at alignment across the row's height, in place of the row's own verticalAlignment.

Link copied to clipboard

Gives the child the row's whole height in place of the height it prefers, up to an explicit maximumSize where it declares one. A child taking the whole height has nowhere left to sit, so this stands in for both its own align and the row's verticalAlignment.

Link copied to clipboard
abstract fun SwingModifier.weight(weight: Float, fill: Boolean = true): SwingModifier

Claims weight shares of the width the row has left over once every child that claims none has taken the width it prefers. Two children weighted 1f and 2f take a third and two thirds of it. A child with an explicit maximumSize takes no more than that maximum allows; what it leaves stays empty. With fill the child occupies all the width it is granted; otherwise it occupies as much of that width as it prefers and the row's arrangement places the rest.