Class Leaflet

All Implemented Interfaces:
Swipeable, Accessible, Buildable, ConstraintTarget, Orientable, Proxy

@Generated("org.javagi.JavaGI") @Deprecated public final class Leaflet extends Widget implements Swipeable, Accessible, Buildable, ConstraintTarget, Orientable
Deprecated.

An adaptive container acting like a box or a stack.

leaflet-wide leaflet-narrow

The AdwLeaflet widget can display its children like a Box does or like a Stack does, adapting to size changes by switching between the two modes.

When there is enough space the children are displayed side by side, otherwise only one is displayed and the leaflet is said to be “folded”. The threshold is dictated by the preferred minimum sizes of the children. When a leaflet is folded, the children can be navigated using swipe gestures.

The “over” and “under” transition types stack the children one on top of the other, while the “slide” transition puts the children side by side. While navigating to a child on the side or below can be performed by swiping the current child away, navigating to an upper child requires dragging it from the edge where it resides. This doesn't affect non-dragging swipes.

CSS nodes

AdwLeaflet has a single CSS node with name leaflet. The node will get the style classes .folded when it is folded, .unfolded when it's not, or none if it hasn't computed its fold yet.

  • Constructor Details

    • Leaflet

      public Leaflet(MemorySegment address)
      Deprecated.
      Create a Leaflet instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Leaflet

      public Leaflet()
      Deprecated.
      Create a new Leaflet.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Deprecated.
      Get the GType of the Leaflet class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      Deprecated.
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected Leaflet asParent()
      Deprecated.
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Widget
      Returns:
      the instance as if it were its parent type
    • append

      @Deprecated public LeafletPage append(Widget child)
      Deprecated.
      Adds a child to self.
      Parameters:
      child - the widget to add
      Returns:
      the LeafletPage for child
    • getAdjacentChild

      @Deprecated public @Nullable Widget getAdjacentChild(NavigationDirection direction)
      Deprecated.

      Finds the previous or next navigatable child.

      This will be the same child navigate(NavigationDirection) or swipe gestures will navigate to.

      If there's no child to navigate to, NULL will be returned instead.

      See LeafletPage:navigatable.

      Parameters:
      direction - the direction
      Returns:
      the previous or next child
    • getCanNavigateBack

      @Deprecated public boolean getCanNavigateBack()
      Deprecated.
      Gets whether gestures and shortcuts for navigating backward are enabled.
      Returns:
      Whether gestures and shortcuts are enabled.
    • getCanNavigateForward

      @Deprecated public boolean getCanNavigateForward()
      Deprecated.
      Gets whether gestures and shortcuts for navigating forward are enabled.
      Returns:
      Whether gestures and shortcuts are enabled.
    • getCanUnfold

      @Deprecated public boolean getCanUnfold()
      Deprecated.
      Gets whether this Leaflet can unfold.
      Returns:
      whether this Leaflet can unfold
    • getChildByName

      @Deprecated public @Nullable Widget getChildByName(String name)
      Deprecated.

      Finds the child of this Leaflet with name.

      Returns NULL if there is no child with this name.

      See LeafletPage:name.

      Parameters:
      name - the name of the child to find
      Returns:
      the requested child of this Leaflet
    • getChildTransitionParams

      @Deprecated public SpringParams getChildTransitionParams()
      Deprecated.
      Gets the child transition spring parameters for self.
      Returns:
      the child transition parameters
    • getChildTransitionRunning

      @Deprecated public boolean getChildTransitionRunning()
      Deprecated.
      Gets whether a child transition is currently running for self.
      Returns:
      whether a transition is currently running
    • getFoldThresholdPolicy

      @Deprecated public FoldThresholdPolicy getFoldThresholdPolicy()
      Deprecated.
      Gets the fold threshold policy for self.
      Returns:
      the fold threshold policy
    • getFolded

      @Deprecated public boolean getFolded()
      Deprecated.

      Gets whether this Leaflet is folded.

      The leaflet will be folded if the size allocated to it is smaller than the sum of the minimum or natural sizes of the children (see Leaflet:fold-threshold-policy), it will be unfolded otherwise.

      Returns:
      whether this Leaflet is folded.
    • getHomogeneous

      @Deprecated public boolean getHomogeneous()
      Deprecated.
      Gets whether this Leaflet is homogeneous.
      Returns:
      whether this Leaflet is homogeneous
    • getModeTransitionDuration

      @Deprecated public int getModeTransitionDuration()
      Deprecated.
      Gets the mode transition animation duration for self.
      Returns:
      the mode transition duration, in milliseconds.
    • getPage

      @Deprecated public LeafletPage getPage(Widget child)
      Deprecated.
      Returns the LeafletPage object for child.
      Parameters:
      child - a child of this Leaflet
      Returns:
      the page object for child
    • getPages

      @Deprecated public SelectionModel getPages()
      Deprecated.

      Returns a ListModel that contains the pages of the leaflet.

      This can be used to keep an up-to-date view. The model also implements SelectionModel and can be used to track and change the visible page.

      Returns:
      a GtkSelectionModel for the leaflet's children
    • getTransitionType

      @Deprecated public LeafletTransitionType getTransitionType()
      Deprecated.
      Gets the type of animation used for transitions between modes and children.
      Returns:
      the current transition type of this Leaflet
    • getVisibleChild

      @Deprecated public @Nullable Widget getVisibleChild()
      Deprecated.
      Gets the widget currently visible when the leaflet is folded.
      Returns:
      the visible child
    • getVisibleChildName

      @Deprecated public @Nullable String getVisibleChildName()
      Deprecated.
      Gets the name of the currently visible child widget.
      Returns:
      the name of the visible child
    • insertChildAfter

      @Deprecated public LeafletPage insertChildAfter(Widget child, @Nullable Widget sibling)
      Deprecated.

      Inserts child in the position after sibling in the list of children.

      If sibling is NULL, inserts child at the first position.

      Parameters:
      child - the widget to insert
      sibling - the sibling after which to insert child
      Returns:
      the LeafletPage for child
    • prepend

      @Deprecated public LeafletPage prepend(Widget child)
      Deprecated.
      Inserts child at the first position in self.
      Parameters:
      child - the widget to prepend
      Returns:
      the LeafletPage for child
    • remove

      @Deprecated public void remove(Widget child)
      Deprecated.
      Removes a child widget from self.
      Parameters:
      child - the child to remove
    • reorderChildAfter

      @Deprecated public void reorderChildAfter(Widget child, @Nullable Widget sibling)
      Deprecated.

      Moves child to the position after sibling in the list of children.

      If sibling is NULL, moves child to the first position.

      Parameters:
      child - the widget to move, must be a child of this Leaflet
      sibling - the sibling to move child after
    • setCanNavigateBack

      @Deprecated public void setCanNavigateBack(boolean canNavigateBack)
      Deprecated.

      Sets whether gestures and shortcuts for navigating backward are enabled.

      The supported gestures are:

      • One-finger swipe on touchscreens
      • Horizontal scrolling on touchpads (usually two-finger swipe)
      • Back/forward mouse buttons

      The keyboard back/forward keys are also supported, as well as the Alt+ shortcut for horizontal orientation, or Alt+ for vertical orientation.

      If the orientation is horizontal, for right-to-left locales, gestures and shortcuts are reversed.

      Only children that have LeafletPage:navigatable set to TRUE can be navigated to.

      Parameters:
      canNavigateBack - the new value
    • setCanNavigateForward

      @Deprecated public void setCanNavigateForward(boolean canNavigateForward)
      Deprecated.

      Sets whether gestures and shortcuts for navigating forward are enabled.

      The supported gestures are:

      • One-finger swipe on touchscreens
      • Horizontal scrolling on touchpads (usually two-finger swipe)
      • Back/forward mouse buttons

      The keyboard back/forward keys are also supported, as well as the Alt+ shortcut for horizontal orientation, or Alt+ for vertical orientation.

      If the orientation is horizontal, for right-to-left locales, gestures and shortcuts are reversed.

      Only children that have LeafletPage:navigatable set to TRUE can be navigated to.

      Parameters:
      canNavigateForward - the new value
    • setCanUnfold

      @Deprecated public void setCanUnfold(boolean canUnfold)
      Deprecated.
      Sets whether this Leaflet can unfold.
      Parameters:
      canUnfold - whether this Leaflet can unfold
    • setChildTransitionParams

      @Deprecated public void setChildTransitionParams(SpringParams params)
      Deprecated.

      Sets the child transition spring parameters for self.

      The default value is equivalent to:

      adw_spring_params_new (1, 0.5, 500)
      
      Parameters:
      params - the new parameters
    • setFoldThresholdPolicy

      @Deprecated public void setFoldThresholdPolicy(FoldThresholdPolicy policy)
      Deprecated.

      Sets the fold threshold policy for self.

      If set to Adw.FoldThresholdPolicy.minimum, it will only fold when the children cannot fit anymore. With Adw.FoldThresholdPolicy.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.

      Parameters:
      policy - the policy to use
    • setHomogeneous

      @Deprecated public void setHomogeneous(boolean homogeneous)
      Deprecated.

      Sets this Leaflet to be homogeneous or not.

      If set to FALSE, different children can have different size along the opposite orientation.

      Parameters:
      homogeneous - whether to make this Leaflet homogeneous
    • setModeTransitionDuration

      @Deprecated public void setModeTransitionDuration(int duration)
      Deprecated.
      Sets the mode transition animation duration for self.
      Parameters:
      duration - the new duration, in milliseconds
    • setTransitionType

      @Deprecated public void setTransitionType(LeafletTransitionType transition)
      Deprecated.

      Sets the type of animation used for transitions between modes and children.

      The transition type can be changed without problems at runtime, so it is possible to change the animation based on the mode or child that is about to become current.

      Parameters:
      transition - the new transition type
    • setVisibleChild

      @Deprecated public void setVisibleChild(Widget visibleChild)
      Deprecated.

      Sets the widget currently visible when the leaflet is folded.

      The transition is determined by Leaflet:transition-type and Leaflet:child-transition-params. The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.

      Parameters:
      visibleChild - the new child
    • setVisibleChildName

      @Deprecated public void setVisibleChildName(String name)
      Deprecated.

      Makes the child with the name name visible.

      See Leaflet:visible-child.

      Parameters:
      name - the name of a child
    • builder

      public static Leaflet.Builder<? extends Leaflet.Builder> builder()
      Deprecated.
      A Leaflet.Builder object constructs a Leaflet with the specified properties. Use the various set...() methods to set properties, and finish construction with Leaflet.Builder.build().
      Returns:
      the builder object