1.21 <AdwClampLayout>

Class: <AdwClampLayout>

It derives from <GtkLayoutManager>.

A layout manager constraining its children to a given size.

<AdwClampLayout> constraints the size of the widgets 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 children from their minimum to their maximum size is eased out for a smooth transition.

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

<AdwClampLayout> can scale with the text scale factor, use the ClampLayout:unit property to enable that behavior.

See also: Clamp, ClampScrollable.

Properties

Property: clamp-layout:maximum-size self

The maximum size to allocate to the children.

It is the width if the layout is horizontal, or the height if it is vertical.

Its value is a 32-bit integer.

Set it with (set! (clamp-layout:maximum-size self) value).

Property: clamp-layout:tightening-threshold self

The size above which the children are clamped.

Starting from this size, the layout will tighten its grip on the children, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the children will be allocated all the available size.

If the threshold is greater than the maximum size to allocate to the children, they will be allocated the whole size up to the maximum. If the threshold is lower than the minimum size to allocate to the children, that size will be used as the tightening threshold.

Effectively, tightening the grip on a child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.

Its value is a 32-bit integer.

Set it with (set! (clamp-layout:tightening-threshold self) value).

Property: clamp-layout:unit self

The length unit for maximum size and tightening threshold.

Allows the sizes to vary depending on the text scale factor.

Its value is a <AdwLengthUnit> (or, to set it, one of its symbols).

Set it with (set! (clamp-layout:unit self) value).

Procedures

Method: clamp-layout:get-maximum-size self ⇒ %return
Method: get-maximum-size self ⇒ %return

Gets the maximum size allocated to the children.

self

Passed: a <AdwClampLayout>.

a clamp layout

%return

Returned: a 32-bit integer.

the maximum size to allocate to the children

Method: clamp-layout:get-tightening-threshold self ⇒ %return
Method: get-tightening-threshold self ⇒ %return

Gets the size above which the children are clamped.

self

Passed: a <AdwClampLayout>.

a clamp layout

%return

Returned: a 32-bit integer.

the size above which the children are clamped

Method: clamp-layout:get-unit self ⇒ %return
Method: get-unit self ⇒ %return

Gets the length unit for maximum size and tightening threshold.

self

Passed: a <AdwClampLayout>.

a clamp layout

%return

Returned: a <AdwLengthUnit>.

the length unit

Procedure: clamp-layout:new ⇒ %return

Creates a new <AdwClampLayout>.

%return

Returned: a <GtkLayoutManager>.

the newly created <AdwClampLayout>

Method: clamp-layout:set-maximum-size self maximum-size
Method: set-maximum-size self maximum-size

Sets the maximum size allocated to the children.

It is the width if the layout is horizontal, or the height if it is vertical.

self

Passed: a <AdwClampLayout>.

a clamp layout

maximum-size

Passed: a 32-bit integer.

the maximum size

Method: clamp-layout:set-tightening-threshold self tightening-threshold
Method: set-tightening-threshold self tightening-threshold

Sets the size above which the children are clamped.

Starting from this size, the layout will tighten its grip on the children, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the children will be allocated all the available size.

If the threshold is greater than the maximum size to allocate to the children, they will be allocated the whole size up to the maximum. If the threshold is lower than the minimum size to allocate to the children, that size will be used as the tightening threshold.

Effectively, tightening the grip on a child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.

self

Passed: a <AdwClampLayout>.

a clamp layout

tightening-threshold

Passed: a 32-bit integer.

the tightening threshold

Method: clamp-layout:set-unit self unit
Method: set-unit self unit

Sets the length unit for maximum size and tightening threshold.

Allows the sizes to vary depending on the text scale factor.

self

Passed: a <AdwClampLayout>.

a clamp layout

unit

Passed: a <AdwLengthUnit>, or one of its symbols.

the length unit