Clamp


Object Hierarchy:

Adw.Clamp Adw.Clamp Adw.Clamp Gtk.Widget Gtk.Widget Gtk.Widget->Adw.Clamp GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Adw.Clamp Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Adw.Clamp Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Adw.Clamp Gtk.ConstraintTarget->Gtk.Widget Gtk.Orientable Gtk.Orientable Gtk.Orientable->Adw.Clamp

Description:

[ CCode ( type_id = "adw_clamp_get_type ()" ) ]
public sealed class Clamp : Widget, Accessible, Buildable, ConstraintTarget, Orientable

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 `AdwClamp` 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.

`AdwClamp` can scale with the text scale factor, use the [property@ClampLayout:unit] property to enable that behavior.

CSS nodes

`AdwClamp` has a single CSS node with name `clamp`.


Namespace: Adw
Package: libadwaita-1

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from interface Gtk.Orientable