Leaflet

class Leaflet(pointer: <Error class: unknown class><<Error class: unknown class>>) : Swipeable

An adaptive container acting like a box or a stack.

leaflet-wide leaflet-narrow

The AdwLeaflet widget can display its children like a class@Gtk.Box does or like a class@Gtk.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.

Skipped during bindings generation

  • method visible-child: Property TypeInfo of getter and setter do not match

  • method visible-child-name: Property TypeInfo of getter and setter do not match

Constructors

Link copied to clipboard
constructor()

Creates a new AdwLeaflet.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val adwLeafletPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val adwSwipeablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Whether gestures and shortcuts for navigating backward are enabled.

Link copied to clipboard

Whether gestures and shortcuts for navigating forward are enabled.

Link copied to clipboard

Whether or not the leaflet can unfold.

Link copied to clipboard

The child transition spring parameters.

Link copied to clipboard

Whether a child transition is currently running.

Link copied to clipboard

Whether the leaflet is folded.

Link copied to clipboard

Determines when the leaflet will fold.

Link copied to clipboard
open val gtkAccessiblePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkConstraintTargetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkOrientablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Whether the leaflet allocates the same size for all children when folded.

Link copied to clipboard
var modeTransitionDuration: <Error class: unknown class>

The mode transition animation duration, in milliseconds.

Link copied to clipboard
val pages: <Error class: unknown class>

A selection model with the leaflet's pages.

Link copied to clipboard

The type of animation used for transitions between modes and children.

Functions

Link copied to clipboard
fun append(child: <Error class: unknown class>): LeafletPage

Adds a child to @self.

Link copied to clipboard
fun getAdjacentChild(direction: NavigationDirection): <Error class: unknown class>?

Finds the previous or next navigatable child.

Link copied to clipboard

Gets the progress @self will snap back to after the gesture is canceled.

Link copied to clipboard

Gets whether gestures and shortcuts for navigating backward are enabled.

Link copied to clipboard

Gets whether gestures and shortcuts for navigating forward are enabled.

Link copied to clipboard

Gets whether @self can unfold.

Link copied to clipboard
fun getChildByName(name: String): <Error class: unknown class>?

Finds the child of @self with @name.

Link copied to clipboard

Gets the child transition spring parameters for @self.

Link copied to clipboard

Gets whether a child transition is currently running for @self.

Link copied to clipboard
open fun getDistance(): Double

Gets the swipe distance of @self.

Link copied to clipboard

Gets whether @self is folded.

Link copied to clipboard

Gets the fold threshold policy for @self.

Link copied to clipboard

Gets whether @self is homogeneous.

Link copied to clipboard
fun getModeTransitionDuration(): <Error class: unknown class>

Gets the mode transition animation duration for @self.

Link copied to clipboard
fun getPage(child: <Error class: unknown class>): LeafletPage

Returns the class@LeafletPage object for @child.

Link copied to clipboard
fun getPages(): <Error class: unknown class>

Returns a iface@Gio.ListModel that contains the pages of the leaflet.

Link copied to clipboard
open fun getProgress(): Double

Gets the current progress of @self.

Link copied to clipboard
open fun getSwipeArea(navigationDirection: NavigationDirection, isDrag: Boolean, rect: <Error class: unknown class>)

Gets the area @self can start a swipe from for the given direction and gesture type.

Link copied to clipboard

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

Link copied to clipboard
fun getVisibleChild(): <Error class: unknown class>?

Gets the widget currently visible when the leaflet is folded.

Link copied to clipboard

Gets the name of the currently visible child widget.

Link copied to clipboard
fun insertChildAfter(child: <Error class: unknown class>, sibling: <Error class: unknown class>? = null): LeafletPage

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

Link copied to clipboard

Navigates to the previous or next child.

Link copied to clipboard
fun prepend(child: <Error class: unknown class>): LeafletPage

Inserts @child at the first position in @self.

Link copied to clipboard
fun remove(child: <Error class: unknown class>)

Removes a child widget from @self.

Link copied to clipboard
fun reorderChildAfter(child: <Error class: unknown class>, sibling: <Error class: unknown class>? = null)

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

Link copied to clipboard
fun setCanNavigateBack(canNavigateBack: Boolean)

Sets whether gestures and shortcuts for navigating backward are enabled.

Link copied to clipboard
fun setCanNavigateForward(canNavigateForward: Boolean)

Sets whether gestures and shortcuts for navigating forward are enabled.

Link copied to clipboard
fun setCanUnfold(canUnfold: Boolean)

Sets whether @self can unfold.

Link copied to clipboard

Sets the child transition spring parameters for @self.

Link copied to clipboard

Sets the fold threshold policy for @self.

Link copied to clipboard
fun setHomogeneous(homogeneous: Boolean)

Sets @self to be homogeneous or not.

Link copied to clipboard
fun setModeTransitionDuration(duration: <Error class: unknown class>)

Sets the mode transition animation duration for @self.

Link copied to clipboard

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

Link copied to clipboard
fun setVisibleChild(visibleChild: <Error class: unknown class>)

Sets the widget currently visible when the leaflet is folded.

Link copied to clipboard

Makes the child with the name @name visible.