AdwClamp

A widget constraining its child to a given size.

<picture> <source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-wide.png" alt="clamp-wide"> </picture> <picture> <source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-narrow.png" alt="clamp-narrow"> </picture>

The adw.clamp.Clamp widget constrains the size of the widget it contains to a given maximum size. It will constrain the width if it is horizontal, or the height if it is vertical. The expansion of the child from its minimum to its maximum size is eased out for a smooth transition.

If the child requires more than the requested maximum size, it will be allocated the minimum size it can fit in instead.

adw.clamp.Clamp can scale with the text scale factor, use the property@Clamp:unit property to enable that behavior.

See also: class@ClampLayout, class@ClampScrollable.

CSS nodes

adw.clamp.Clamp has a single CSS node with name clamp.

struct AdwClamp