plushie/prop/length

Length type for widget dimensions.

Lengths control how widgets size themselves within their parent. Fill expands to available space, Shrink wraps content, FillPortion distributes space proportionally, and Fixed sets an exact pixel size.

Types

pub type Length {
  Fill
  Shrink
  FillPortion(portion: Int)
  Fixed(pixels: Float)
}

Constructors

  • Fill
  • Shrink
  • FillPortion(portion: Int)
  • Fixed(pixels: Float)

Values

pub fn to_prop_value(length: Length) -> node.PropValue

Encode a Length to its wire-format PropValue.

Search Document