Leaflet
An adaptive container acting like a box or a stack.
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 matchmethod
visible-child-name
: Property TypeInfo of getter and setter do not match
Constructors
Properties
Whether gestures and shortcuts for navigating backward are enabled.
Whether gestures and shortcuts for navigating forward are enabled.
The child transition spring parameters.
Whether a child transition is currently running.
Determines when the leaflet will fold.
Whether the leaflet allocates the same size for all children when folded.
The mode transition animation duration, in milliseconds.
The type of animation used for transitions between modes and children.
Functions
Adds a child to @self.
Finds the previous or next navigatable child.
Gets the progress @self will snap back to after the gesture is canceled.
Gets whether gestures and shortcuts for navigating backward are enabled.
Gets whether gestures and shortcuts for navigating forward are enabled.
Gets whether @self can unfold.
Finds the child of @self with @name.
Gets the child transition spring parameters for @self.
Gets whether a child transition is currently running for @self.
Gets the swipe distance of @self.
Gets the fold threshold policy for @self.
Gets whether @self is homogeneous.
Gets the mode transition animation duration for @self.
Returns the class@LeafletPage object for @child.
Gets the current progress of @self.
Gets the area @self can start a swipe from for the given direction and gesture type.
Gets the type of animation used for transitions between modes and children.
Gets the widget currently visible when the leaflet is folded.
Gets the name of the currently visible child widget.
Inserts @child in the position after @sibling in the list of children.
Navigates to the previous or next child.
Inserts @child at the first position in @self.
Moves @child to the position after @sibling in the list of children.
Sets whether gestures and shortcuts for navigating backward are enabled.
Sets whether gestures and shortcuts for navigating forward are enabled.
Sets whether @self can unfold.
Sets the child transition spring parameters for @self.
Sets the fold threshold policy for @self.
Sets @self to be homogeneous or not.
Sets the mode transition animation duration for @self.
Sets the type of animation used for transitions between modes and children.
Sets the widget currently visible when the leaflet is folded.
Makes the child with the name @name visible.