ClampLayout

A layout manager constraining its children 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>

adw.clamp_layout.ClampLayout 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.

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

See also: class@Clamp, class@ClampScrollable.

Constructors

this
this()

Creates a new adw.clamp_layout.ClampLayout.

Members

Functions

getMaximumSize
int getMaximumSize()

Gets the maximum size allocated to the children.

getTighteningThreshold
int getTighteningThreshold()

Gets the size above which the children are clamped.

getUnit
adw.types.LengthUnit getUnit()

Gets the length unit for maximum size and tightening threshold.

setMaximumSize
void setMaximumSize(int maximumSize)

Sets the maximum size allocated to the children.

setTighteningThreshold
void setTighteningThreshold(int tighteningThreshold)

Sets the size above which the children are clamped.

setUnit
void setUnit(adw.types.LengthUnit unit)

Sets the length unit for maximum size and tightening threshold.

Mixed In Members

From mixin OrientableT!()

getOrientation
gtk.types.Orientation getOrientation()

Retrieves the orientation of the orientable.

setOrientation
void setOrientation(gtk.types.Orientation orientation)

Sets the orientation of the orientable.

Inherited Members

From LayoutManager

allocate
void allocate(gtk.widget.Widget widget, int width, int height, int baseline)

Assigns the given width, height, and baseline to a widget, and computes the position and sizes of the children of the widget using the layout management policy of manager.

getLayoutChild
gtk.layout_child.LayoutChild getLayoutChild(gtk.widget.Widget child)

Retrieves a gtk.layout_child.LayoutChild instance for the gtk.layout_manager.LayoutManager, creating one if necessary.

getRequestMode
gtk.types.SizeRequestMode getRequestMode()

Retrieves the request mode of manager.

getWidget
gtk.widget.Widget getWidget()

Retrieves the gtk.widget.Widget using the given gtk.layout_manager.LayoutManager.

layoutChanged
void layoutChanged()

Queues a resize on the gtk.widget.Widget using manager, if any.

measure
void measure(gtk.widget.Widget widget, gtk.types.Orientation orientation, int forSize, int minimum, int natural, int minimumBaseline, int naturalBaseline)

Measures the size of the widget using manager, for the given orientation and size.

From Orientable

getOrientation
gtk.types.Orientation getOrientation()

Retrieves the orientation of the orientable.

setOrientation
void setOrientation(gtk.types.Orientation orientation)

Sets the orientation of the orientable.