Klasse ClampLayout

Alle implementierten Schnittstellen:
PointerInterface

public class ClampLayout extends LayoutManager
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>

`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
[property@ClampLayout:unit] property to enable that behavior.

See also: [class@Clamp], [class@ClampScrollable].

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ClampLayout.html

  • Konstruktordetails

    • ClampLayout

      public ClampLayout(PointerContainer pointer)
    • ClampLayout

      public ClampLayout()
      Creates a new `AdwClampLayout`.
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getMaximumSize

      public int getMaximumSize()
      Gets the maximum size allocated to the children.
      Gibt zurück:
      the maximum size to allocate to the children
    • getTighteningThreshold

      public int getTighteningThreshold()
      Gets the size above which the children are clamped.
      Gibt zurück:
      the size above which the children are clamped
    • getUnit

      public int getUnit()
      Gets the length unit for maximum size and tightening threshold.
      Gibt zurück:
      the length unit
    • setMaximumSize

      public void setMaximumSize(int 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.
      Parameter:
      maximum_size - the maximum size
    • setTighteningThreshold

      public void setTighteningThreshold(int 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.
      Parameter:
      tightening_threshold - the tightening threshold
    • setUnit

      public void setUnit(int unit)
      Sets the length unit for maximum size and tightening threshold.

      Allows the sizes to vary depending on the text scale factor.
      Parameter:
      unit - the length unit
    • asOrientable

      public Orientable asOrientable()
      Implements interface Orientable. Call this to get access to interface functions.
      Gibt zurück:
      Orientable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()