adw.leaflet
Module for [Leaflet] class
Types 3
An adaptive container acting like a box or a stack.
The [adw.leaflet.Leaflet] widget can display its children like a [gtk.box.Box] does or like a [gtk.stack.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
[adw.leaflet.Leaflet] 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.
Deprecated
LeafletGidBuilder builder()Get builder for [adw.leaflet.Leaflet] Returns: New builder objectbool canNavigateBack() @propertyGet `canNavigateBack` property. Returns: Whether gestures and shortcuts for navigating backward are enabled.void canNavigateBack(bool propval) @propertySet `canNavigateBack` property. Params: propval = Whether gestures and shortcuts for navigating backward are enabled.bool canNavigateForward() @propertyGet `canNavigateForward` property. Returns: Whether gestures and shortcuts for navigating forward are enabled.void canNavigateForward(bool propval) @propertySet `canNavigateForward` property. Params: propval = Whether gestures and shortcuts for navigating forward are enabled.void canUnfold(bool propval) @propertySet `canUnfold` property. Params: propval = Whether or not the leaflet can unfold.adw.spring_params.SpringParams childTransitionParams() @propertyGet `childTransitionParams` property. Returns: The child transition spring parameters.void childTransitionParams(adw.spring_params.SpringParams propval) @propertySet `childTransitionParams` property. Params: propval = The child transition spring parameters.bool childTransitionRunning() @propertyGet `childTransitionRunning` property. Returns: Whether a child transition is currently running.adw.types.FoldThresholdPolicy foldThresholdPolicy() @propertyGet `foldThresholdPolicy` property. Returns: Determines when the leaflet will fold.void foldThresholdPolicy(adw.types.FoldThresholdPolicy propval) @propertySet `foldThresholdPolicy` property. Params: propval = Determines when the leaflet will fold.bool homogeneous() @propertyGet `homogeneous` property. Returns: Whether the leaflet allocates the same size for all children when folded.void homogeneous(bool propval) @propertySet `homogeneous` property. Params: propval = Whether the leaflet allocates the same size for all children when folded.uint modeTransitionDuration() @propertyGet `modeTransitionDuration` property. Returns: The mode transition animation duration, in milliseconds.void modeTransitionDuration(uint propval) @propertySet `modeTransitionDuration` property. Params: propval = The mode transition animation duration, in milliseconds.gtk.selection_model.SelectionModel pages() @propertyGet `pages` property. Returns: A selection model with the leaflet's pages.adw.types.LeafletTransitionType transitionType() @propertyGet `transitionType` property. Returns: The type of animation used for transitions between modes and children.void transitionType(adw.types.LeafletTransitionType propval) @propertySet `transitionType` property. Params: propval = The type of animation used for transitions between modes and children.gtk.widget.Widget visibleChild() @propertyGet `visibleChild` property. Returns: The widget currently visible when the leaflet is folded.void visibleChild(gtk.widget.Widget propval) @propertySet `visibleChild` property. Params: propval = The widget currently visible when the leaflet is folded.string visibleChildName() @propertyGet `visibleChildName` property. Returns: The name of the widget currently visible when the leaflet is folded.void visibleChildName(string propval) @propertySet `visibleChildName` property. Params: propval = The name of the widget currently visible when the leaflet is folded.adw.leaflet_page.LeafletPage append(gtk.widget.Widget child)Adds a child to self.gtk.widget.Widget getAdjacentChild(adw.types.NavigationDirection direction)Finds the previous or next navigatable child.bool getCanNavigateBack()Gets whether gestures and shortcuts for navigating backward are enabled. Returns: Whether gestures and shortcuts are enabled.bool getCanNavigateForward()Gets whether gestures and shortcuts for navigating forward are enabled. Returns: Whether gestures and shortcuts are enabled.bool getCanUnfold()Gets whether self can unfold. Returns: whether self can unfoldgtk.widget.Widget getChildByName(string name)Finds the child of self with name.adw.spring_params.SpringParams getChildTransitionParams()Gets the child transition spring parameters for self. Returns: the child transition parametersbool getChildTransitionRunning()Gets whether a child transition is currently running for self. Returns: whether a transition is currently runningadw.types.FoldThresholdPolicy getFoldThresholdPolicy()Gets the fold threshold policy for self. Returns: the fold threshold policybool getFolded()Gets whether self is folded.bool getHomogeneous()Gets whether self is homogeneous. Returns: whether self is homogeneousuint getModeTransitionDuration()Gets the mode transition animation duration for self. Returns: the mode transition duration, in milliseconds.adw.leaflet_page.LeafletPage getPage(gtk.widget.Widget child)Returns the `classLeafletPage` object for child.gtk.selection_model.SelectionModel getPages()Returns a [gio.list_model.ListModel] that contains the pages of the leaflet.adw.types.LeafletTransitionType getTransitionType()Gets the type of animation used for transitions between modes and children. Returns: the current transition type of selfgtk.widget.Widget getVisibleChild()Gets the widget currently visible when the leaflet is folded. Returns: the visible childstring getVisibleChildName()Gets the name of the currently visible child widget. Returns: the name of the visible childadw.leaflet_page.LeafletPage insertChildAfter(gtk.widget.Widget child, gtk.widget.Widget sibling = null)Inserts child in the position after sibling in the list of children.bool navigate(adw.types.NavigationDirection direction)Navigates to the previous or next child.adw.leaflet_page.LeafletPage prepend(gtk.widget.Widget child)Inserts child at the first position in self.void remove(gtk.widget.Widget child)Removes a child widget from self.void reorderChildAfter(gtk.widget.Widget child, gtk.widget.Widget sibling = null)Moves child to the position after sibling in the list of children.void setCanNavigateBack(bool canNavigateBack)Sets whether gestures and shortcuts for navigating backward are enabled.void setCanNavigateForward(bool canNavigateForward)Sets whether gestures and shortcuts for navigating forward are enabled.void setCanUnfold(bool canUnfold)Sets whether self can unfold.void setChildTransitionParams(adw.spring_params.SpringParams params)Sets the child transition spring parameters for self.void setFoldThresholdPolicy(adw.types.FoldThresholdPolicy policy)Sets the fold threshold policy for self.void setHomogeneous(bool homogeneous)Sets self to be homogeneous or not.void setModeTransitionDuration(uint duration)Sets the mode transition animation duration for self.void setTransitionType(adw.types.LeafletTransitionType transition)Sets the type of animation used for transitions between modes and children.void setVisibleChild(gtk.widget.Widget visibleChild)Sets the widget currently visible when the leaflet is folded.void setVisibleChildName(string name)Makes the child with the name name visible.T canNavigateBack(bool propval)Set `canNavigateBack` property. Params: propval = Whether gestures and shortcuts for navigating backward are enabled.T canNavigateForward(bool propval)Set `canNavigateForward` property. Params: propval = Whether gestures and shortcuts for navigating forward are enabled.T canUnfold(bool propval)Set `canUnfold` property. Params: propval = Whether or not the leaflet can unfold. Returns: Builder instance for fluent chainingT childTransitionParams(adw.spring_params.SpringParams propval)Set `childTransitionParams` property. Params: propval = The child transition spring parameters.T foldThresholdPolicy(adw.types.FoldThresholdPolicy propval)Set `foldThresholdPolicy` property. Params: propval = Determines when the leaflet will fold.T homogeneous(bool propval)Set `homogeneous` property. Params: propval = Whether the leaflet allocates the same size for all children when folded.T modeTransitionDuration(uint propval)Set `modeTransitionDuration` property. Params: propval = The mode transition animation duration, in milliseconds. Returns: Builder instance for fluent chainingT transitionType(adw.types.LeafletTransitionType propval)Set `transitionType` property. Params: propval = The type of animation used for transitions between modes and children.T visibleChild(gtk.widget.Widget propval)Set `visibleChild` property. Params: propval = The widget currently visible when the leaflet is folded.T visibleChildName(string propval)Set `visibleChildName` property. Params: propval = The name of the widget currently visible when the leaflet is folded.