Klasse Squeezer

Alle implementierten Schnittstellen:
PointerInterface

public class Squeezer extends Widget
A best fit container.

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

The `AdwSqueezer` widget is a container which only shows the first of its
children that fits in the available size. It is convenient to offer different
widgets to represent the same data with different levels of detail, making
the widget seem to squeeze itself to fit in the available space.

Transitions between children can be animated as fades. This can be controlled
with [property@Squeezer:transition-type].

## CSS nodes

`AdwSqueezer` has a single CSS node with name `squeezer`.

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

  • Konstruktordetails Linksymbol

  • Methodendetails Linksymbol

    • getClassHandler Linksymbol

      public static ClassHandler getClassHandler()
    • add Linksymbol

      @Deprecated public SqueezerPage add(@Nonnull Widget child)
      Veraltet.
      Adds a child to @self.
      Parameter:
      child - the widget to add
      Gibt zurück:
      the [class@SqueezerPage] for @child
    • getAllowNone Linksymbol

      @Deprecated public boolean getAllowNone()
      Veraltet.
      Gets whether to allow squeezing beyond the last child's minimum size.
      Gibt zurück:
      whether @self allows squeezing beyond the last child
    • getHomogeneous Linksymbol

      @Deprecated public boolean getHomogeneous()
      Veraltet.
      Gets whether all children have the same size for the opposite orientation.
      Gibt zurück:
      whether @self is homogeneous
    • getInterpolateSize Linksymbol

      @Deprecated public boolean getInterpolateSize()
      Veraltet.
      Gets whether @self interpolates its size when changing the visible child.
      Gibt zurück:
      whether the size is interpolated
    • getPage Linksymbol

      @Deprecated public SqueezerPage getPage(@Nonnull Widget child)
      Veraltet.
      Returns the [class@SqueezerPage] object for @child.
      Parameter:
      child - a child of @self
      Gibt zurück:
      the page object for @child
    • getPages Linksymbol

      @Deprecated public SelectionModel getPages()
      Veraltet.
      Returns a [iface@Gio.ListModel] that contains the pages of @self.

      This can be used to keep an up-to-date view. The model also implements
      [iface@Gtk.SelectionModel] and can be used to track the visible page.
      Gibt zurück:
      a `GtkSelectionModel` for the squeezer's children
    • getSwitchThresholdPolicy Linksymbol

      @Deprecated public int getSwitchThresholdPolicy()
      Veraltet.
      Gets the switch threshold policy for @self.
      Gibt zurück:
      the fold threshold policy
    • getTransitionDuration Linksymbol

      @Deprecated public int getTransitionDuration()
      Veraltet.
      Gets the transition animation duration for @self.
      Gibt zurück:
      the transition duration, in milliseconds
    • getTransitionRunning Linksymbol

      @Deprecated public boolean getTransitionRunning()
      Veraltet.
      Gets whether a transition is currently running for @self.

      If a transition is impossible, the property value will be set to `TRUE` and
      then immediately to `FALSE`, so it's possible to rely on its notifications
      to know that a transition has happened.
      Gibt zurück:
      whether a transition is currently running
    • getTransitionType Linksymbol

      @Deprecated public int getTransitionType()
      Veraltet.
      Gets the type of animation used for transitions between children in @self.
      Gibt zurück:
      the current transition type of @self
    • getVisibleChild Linksymbol

      @Deprecated public Widget getVisibleChild()
      Veraltet.
      Gets the currently visible child of @self.
      Gibt zurück:
      the visible child
    • getXalign Linksymbol

      @Deprecated public float getXalign()
      Veraltet.
      Gets the horizontal alignment, from 0 (start) to 1 (end).
      Gibt zurück:
      the alignment value
    • getYalign Linksymbol

      @Deprecated public float getYalign()
      Veraltet.
      Gets the vertical alignment, from 0 (top) to 1 (bottom).
      Gibt zurück:
      the alignment value
    • remove Linksymbol

      @Deprecated public void remove(@Nonnull Widget child)
      Veraltet.
      Removes a child widget from @self.
      Parameter:
      child - the child to remove
    • setAllowNone Linksymbol

      @Deprecated public void setAllowNone(boolean allow_none)
      Veraltet.
      Sets whether to allow squeezing beyond the last child's minimum size.

      If set to `TRUE`, the squeezer can shrink to the point where no child can be
      shown. This is functionally equivalent to appending a widget with 0×0 minimum
      size.
      Parameter:
      allow_none - whether @self allows squeezing beyond the last child
    • setHomogeneous Linksymbol

      @Deprecated public void setHomogeneous(boolean homogeneous)
      Veraltet.
      Sets whether all children have the same size for the opposite orientation.

      For example, if a squeezer is horizontal and is homogeneous, it will request
      the same height for all its children. If it isn't, the squeezer may change
      size when a different child becomes visible.
      Parameter:
      homogeneous - whether @self is homogeneous
    • setInterpolateSize Linksymbol

      @Deprecated public void setInterpolateSize(boolean interpolate_size)
      Veraltet.
      Sets whether @self interpolates its size when changing the visible child.

      If `TRUE`, the squeezer will interpolate its size between the one of the
      previous visible child and the one of the new visible child, according to the
      set transition duration and the orientation, e.g. if the squeezer is
      horizontal, it will interpolate the its height.
      Parameter:
      interpolate_size - whether to interpolate the size
    • setSwitchThresholdPolicy Linksymbol

      @Deprecated public void setSwitchThresholdPolicy(int policy)
      Veraltet.
      Sets the switch threshold policy for @self.

      Determines when the squeezer will switch children.

      If set to `ADW_FOLD_THRESHOLD_POLICY_MINIMUM`, it will only switch when the
      visible child cannot fit anymore. With `ADW_FOLD_THRESHOLD_POLICY_NATURAL`,
      it will switch as soon as the visible child doesn't get their natural size.

      This can be useful if you have a long ellipsizing label and want to let it
      ellipsize instead of immediately switching.
      Parameter:
      policy - the policy to use
    • setTransitionDuration Linksymbol

      @Deprecated public void setTransitionDuration(int duration)
      Veraltet.
      Sets the transition animation duration for @self.
      Parameter:
      duration - the new duration, in milliseconds
    • setTransitionType Linksymbol

      @Deprecated public void setTransitionType(int transition)
      Veraltet.
      Sets the type of animation used for transitions between children in @self.
      Parameter:
      transition - the new transition type
    • setXalign Linksymbol

      @Deprecated public void setXalign(float xalign)
      Veraltet.
      Sets the horizontal alignment, from 0 (start) to 1 (end).

      This affects the children allocation during transitions, when they exceed the
      size of the squeezer.

      For example, 0.5 means the child will be centered, 0 means it will keep the
      start side aligned and overflow the end side, and 1 means the opposite.
      Parameter:
      xalign - the new alignment value
    • setYalign Linksymbol

      @Deprecated public void setYalign(float yalign)
      Veraltet.
      Sets the vertical alignment, from 0 (top) to 1 (bottom).

      This affects the children allocation during transitions, when they exceed the
      size of the squeezer.

      For example, 0.5 means the child will be centered, 0 means it will keep the
      top side aligned and overflow the bottom side, and 1 means the opposite.
      Parameter:
      yalign - the new alignment value
    • asAccessible Linksymbol

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Setzt außer Kraft:
      asAccessible in Klasse Widget
      Gibt zurück:
      Accessible
    • asBuildable Linksymbol

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Setzt außer Kraft:
      asBuildable in Klasse Widget
      Gibt zurück:
      Buildable
    • asConstraintTarget Linksymbol

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Setzt außer Kraft:
      asConstraintTarget in Klasse Widget
      Gibt zurück:
      ConstraintTarget
    • asOrientable Linksymbol

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

      public static long getTypeID()
    • getParentTypeID Linksymbol

      public static long getParentTypeID()
    • getTypeSize Linksymbol

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize Linksymbol

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize Linksymbol

      public static int getInstanceSize()