Klasse Flap

Alle implementierten Schnittstellen:
PointerInterface

public class Flap extends Widget
An adaptive container acting like a box or an overlay.

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

The `AdwFlap` widget can display its children like a [class@Gtk.Box] does or
like a [class@Gtk.Overlay] does, according to the
[property@Flap:fold-policy] value.

`AdwFlap` has at most three children: [property@Flap:content],
[property@Flap:flap] and [property@Flap:separator]. Content is the primary
child, flap is displayed next to it when unfolded, or overlays it when
folded. Flap can be shown or hidden by changing the
[property@Flap:reveal-flap] value, as well as via swipe gestures if
[property@Flap:swipe-to-open] and/or [property@Flap:swipe-to-close] are set
to `TRUE`.

Optionally, a separator can be provided, which would be displayed between
the content and the flap when there's no shadow to separate them, depending
on the transition type.

[property@Flap:flap] is transparent by default; add the
[`.background`](style-classes.html#background) style class to it if this is
unwanted.

If [property@Flap:modal] is set to `TRUE`, content becomes completely
inaccessible when the flap is revealed while folded.

The position of the flap and separator children relative to the content is
determined by orientation, as well as the [property@Flap:flap-position]
value.

Folding the flap will automatically hide the flap widget, and unfolding it
will automatically reveal it. If this behavior is not desired, the
[property@Flap:locked] property can be used to override it.

Common use cases include sidebars, header bars that need to be able to
overlap the window content (for example, in fullscreen mode) and bottom
sheets.

## AdwFlap as GtkBuildable

The `AdwFlap` implementation of the [iface@Gtk.Buildable] interface supports
setting the flap child by specifying “flap” as the “type” attribute of a
`<child>` element, and separator by specifying “separator”. Specifying
“content” child type or omitting it results in setting the content child.

## CSS nodes

`AdwFlap` has a single CSS node with name `flap`. The node will get the style
classes `.folded` when it is folded, and `.unfolded` when it's not.

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

  • Konstruktordetails

  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getContent

      @Deprecated public Widget getContent()
      Veraltet.
      Gets the content widget for @self.
      Gibt zurück:
      the content widget for @self
    • getFlap

      @Deprecated public Widget getFlap()
      Veraltet.
      Gets the flap widget for @self.
      Gibt zurück:
      the flap widget for @self
    • getFlapPosition

      @Deprecated public int getFlapPosition()
      Veraltet.
      Gets the flap position for @self.
      Gibt zurück:
      the flap position for @self
    • getFoldDuration

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

      @Deprecated public int getFoldPolicy()
      Veraltet.
      Gets the fold policy for @self.
      Gibt zurück:
      the fold policy for @self
    • getFoldThresholdPolicy

      @Deprecated public int getFoldThresholdPolicy()
      Veraltet.
      Gets the fold threshold policy for @self.
      Gibt zurück:
      the fold threshold policy
    • getFolded

      @Deprecated public boolean getFolded()
      Veraltet.
      Gets whether @self is currently folded.

      See [property@Flap:fold-policy].
      Gibt zurück:
      `TRUE` if @self is currently folded
    • getLocked

      @Deprecated public boolean getLocked()
      Veraltet.
      Gets whether @self is locked.
      Gibt zurück:
      `TRUE` if @self is locked
    • getModal

      @Deprecated public boolean getModal()
      Veraltet.
      Gets whether @self is modal.
      Gibt zurück:
      `TRUE` if @self is modal
    • getRevealFlap

      @Deprecated public boolean getRevealFlap()
      Veraltet.
      Gets whether the flap widget is revealed for @self.
      Gibt zurück:
      `TRUE` if the flap widget is revealed
    • getRevealParams

      @Deprecated public SpringParams getRevealParams()
      Veraltet.
      Gets the reveal animation spring parameters for @self.
      Gibt zurück:
      the reveal animation parameters
    • getRevealProgress

      @Deprecated public double getRevealProgress()
      Veraltet.
      Gets the current reveal progress for @self.

      0 means fully hidden, 1 means fully revealed.

      See [property@Flap:reveal-flap].
      Gibt zurück:
      the current reveal progress for @self
    • getSeparator

      @Deprecated public Widget getSeparator()
      Veraltet.
      Gets the separator widget for @self.
      Gibt zurück:
      the separator widget for @self
    • getSwipeToClose

      @Deprecated public boolean getSwipeToClose()
      Veraltet.
      Gets whether @self can be closed with a swipe gesture.
      Gibt zurück:
      `TRUE` if @self can be closed with a swipe gesture
    • getSwipeToOpen

      @Deprecated public boolean getSwipeToOpen()
      Veraltet.
      Gets whether @self can be opened with a swipe gesture.
      Gibt zurück:
      `TRUE` if @self can be opened with a swipe gesture
    • getTransitionType

      @Deprecated public int getTransitionType()
      Veraltet.
      Gets the type of animation used for reveal and fold transitions in @self.
      Gibt zurück:
      the current transition type of @self
    • setContent

      @Deprecated public void setContent(@Nullable Widget content)
      Veraltet.
      Sets the content widget for @self.

      It's always displayed when unfolded, and partially visible when folded.
      Parameter:
      content - the content widget
    • setFlap

      @Deprecated public void setFlap(@Nullable Widget flap)
      Veraltet.
      Sets the flap widget for @self.

      It's only visible when [property@Flap:reveal-progress] is greater than 0.
      Parameter:
      flap - the flap widget
    • setFlapPosition

      @Deprecated public void setFlapPosition(int position)
      Veraltet.
      Sets the flap position for @self.

      If it's set to `GTK_PACK_START`, the flap is displayed before the content,
      if `GTK_PACK_END`, it's displayed after the content.
      Parameter:
      position - the new value
    • setFoldDuration

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

      @Deprecated public void setFoldPolicy(int policy)
      Veraltet.
      Sets the fold policy for @self.
      Parameter:
      policy - the fold policy
    • setFoldThresholdPolicy

      @Deprecated public void setFoldThresholdPolicy(int policy)
      Veraltet.
      Sets the fold threshold policy for @self.

      If set to `ADW_FOLD_THRESHOLD_POLICY_MINIMUM`, flap will only fold when the
      children cannot fit anymore. With `ADW_FOLD_THRESHOLD_POLICY_NATURAL`, it
      will fold as soon as children don'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 folding.
      Parameter:
      policy - the policy to use
    • setLocked

      @Deprecated public void setLocked(boolean locked)
      Veraltet.
      Sets whether @self is locked.

      If `FALSE`, folding when the flap is revealed automatically closes it, and
      unfolding it when the flap is not revealed opens it. If `TRUE`,
      [property@Flap:reveal-flap] value never changes on its own.
      Parameter:
      locked - the new value
    • setModal

      @Deprecated public void setModal(boolean modal)
      Veraltet.
      Sets whether @self is modal.

      If `TRUE`, clicking the content widget while flap is revealed, as well as
      pressing the <kbd>Esc</kbd> key, will close the flap. If `FALSE`, clicks are
      passed through to the content widget.
      Parameter:
      modal - whether @self is modal
    • setRevealFlap

      @Deprecated public void setRevealFlap(boolean reveal_flap)
      Veraltet.
      Sets whether the flap widget is revealed for @self.
      Parameter:
      reveal_flap - whether to reveal the flap widget
    • setRevealParams

      @Deprecated public void setRevealParams(@Nonnull SpringParams params)
      Veraltet.
      Sets the reveal animation spring parameters for @self.

      The default value is equivalent to:

      ```c
      adw_spring_params_new (1, 0.5, 500)
      ```
      Parameter:
      params - the new parameters
    • setSeparator

      @Deprecated public void setSeparator(@Nullable Widget separator)
      Veraltet.
      Sets the separator widget for @self.

      It's displayed between content and flap when there's no shadow to display.
      When exactly it's visible depends on the [property@Flap:transition-type]
      value.
      Parameter:
      separator - the separator widget
    • setSwipeToClose

      @Deprecated public void setSwipeToClose(boolean swipe_to_close)
      Veraltet.
      Sets whether @self can be closed with a swipe gesture.

      The area that can be swiped depends on the [property@Flap:transition-type]
      value.
      Parameter:
      swipe_to_close - whether @self can be closed with a swipe gesture
    • setSwipeToOpen

      @Deprecated public void setSwipeToOpen(boolean swipe_to_open)
      Veraltet.
      Sets whether @self can be opened with a swipe gesture.

      The area that can be swiped depends on the [property@Flap:transition-type]
      value.
      Parameter:
      swipe_to_open - whether @self can be opened with a swipe gesture
    • setTransitionType

      @Deprecated public void setTransitionType(int transition_type)
      Veraltet.
      Sets the type of animation used for reveal and fold transitions in @self.

      [property@Flap:flap] is transparent by default, which means the content will
      be seen through it with `ADW_FLAP_TRANSITION_TYPE_OVER` transitions; add the
      [`.background`](style-classes.html#background) style class to it if this is
      unwanted.
      Parameter:
      transition_type - the new transition type
    • asSwipeable

      public Swipeable asSwipeable()
      Implements interface Swipeable. Call this to get access to interface functions.
      Gibt zurück:
      Swipeable
    • asAccessible

      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

      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

      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

      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()