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() static nothrowGet builder for [adw.leaflet.Leaflet] Returns: New builder objectbool canNavigateBack() @property nothrowGet `canNavigateBack` property. Returns: Whether gestures and shortcuts for navigating backward are enabled.void canNavigateBack(bool propval) @property nothrowSet `canNavigateBack` property. Params: propval = Whether gestures and shortcuts for navigating backward are enabled.bool canNavigateForward() @property nothrowGet `canNavigateForward` property. Returns: Whether gestures and shortcuts for navigating forward are enabled.void canNavigateForward(bool propval) @property nothrowSet `canNavigateForward` property. Params: propval = Whether gestures and shortcuts for navigating forward are enabled.bool canUnfold() @property nothrowGet `canUnfold` property. Returns: Whether or not the leaflet can unfold.void canUnfold(bool propval) @property nothrowSet `canUnfold` property. Params: propval = Whether or not the leaflet can unfold.adw.spring_params.SpringParams childTransitionParams() @property nothrowGet `childTransitionParams` property. Returns: The child transition spring parameters.void childTransitionParams(adw.spring_params.SpringParams propval) @property nothrowSet `childTransitionParams` property. Params: propval = The child transition spring parameters.bool childTransitionRunning() @property nothrowGet `childTransitionRunning` property. Returns: Whether a child transition is currently running.adw.types.FoldThresholdPolicy foldThresholdPolicy() @property nothrowGet `foldThresholdPolicy` property. Returns: Determines when the leaflet will fold.void foldThresholdPolicy(adw.types.FoldThresholdPolicy propval) @property nothrowSet `foldThresholdPolicy` property. Params: propval = Determines when the leaflet will fold.bool homogeneous() @property nothrowGet `homogeneous` property. Returns: Whether the leaflet allocates the same size for all children when folded.void homogeneous(bool propval) @property nothrowSet `homogeneous` property. Params: propval = Whether the leaflet allocates the same size for all children when folded.uint modeTransitionDuration() @property nothrowGet `modeTransitionDuration` property. Returns: The mode transition animation duration, in milliseconds.void modeTransitionDuration(uint propval) @property nothrowSet `modeTransitionDuration` property. Params: propval = The mode transition animation duration, in milliseconds.gtk.selection_model.SelectionModel pages() @property nothrowGet `pages` property. Returns: A selection model with the leaflet's pages.adw.types.LeafletTransitionType transitionType() @property nothrowGet `transitionType` property. Returns: The type of animation used for transitions between modes and children.void transitionType(adw.types.LeafletTransitionType propval) @property nothrowSet `transitionType` property. Params: propval = The type of animation used for transitions between modes and children.gtk.widget.Widget visibleChild() @property nothrowGet `visibleChild` property. Returns: The widget currently visible when the leaflet is folded.void visibleChild(gtk.widget.Widget propval) @property nothrowSet `visibleChild` property. Params: propval = The widget currently visible when the leaflet is folded.string visibleChildName() @property nothrowGet `visibleChildName` property. Returns: The name of the widget currently visible when the leaflet is folded.void visibleChildName(string propval) @property nothrowSet `visibleChildName` property. Params: propval = The name of the widget currently visible when the leaflet is folded.gtk.widget.Widget getAdjacentChild(adw.types.NavigationDirection direction) nothrowFinds the previous or next navigatable child.bool getCanNavigateBack() nothrowGets whether gestures and shortcuts for navigating backward are enabled. Returns: Whether gestures and shortcuts are enabled.bool getCanNavigateForward() nothrowGets whether gestures and shortcuts for navigating forward are enabled. Returns: Whether gestures and shortcuts are enabled.adw.spring_params.SpringParams getChildTransitionParams() nothrowGets the child transition spring parameters for self. Returns: the child transition parametersbool getChildTransitionRunning() nothrowGets whether a child transition is currently running for self. Returns: whether a transition is currently runningadw.types.FoldThresholdPolicy getFoldThresholdPolicy() nothrowGets the fold threshold policy for self. Returns: the fold threshold policyuint getModeTransitionDuration() nothrowGets the mode transition animation duration for self. Returns: the mode transition duration, in milliseconds.adw.leaflet_page.LeafletPage getPage(gtk.widget.Widget child) nothrowReturns the [adw.leaflet_page.LeafletPage] object for child.gtk.selection_model.SelectionModel getPages() nothrowReturns a [gio.list_model.ListModel] that contains the pages of the leaflet.adw.types.LeafletTransitionType getTransitionType() nothrowGets the type of animation used for transitions between modes and children. Returns: the current transition type of selfgtk.widget.Widget getVisibleChild() nothrowGets the widget currently visible when the leaflet is folded. Returns: the visible childstring getVisibleChildName() nothrowGets 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) nothrowInserts child in the position after sibling in the list of children.bool navigate(adw.types.NavigationDirection direction) nothrowNavigates to the previous or next child.adw.leaflet_page.LeafletPage prepend(gtk.widget.Widget child) nothrowInserts child at the first position in self.void reorderChildAfter(gtk.widget.Widget child, gtk.widget.Widget sibling = null) nothrowMoves child to the position after sibling in the list of children.void setCanNavigateBack(bool canNavigateBack) nothrowSets whether gestures and shortcuts for navigating backward are enabled.void setCanNavigateForward(bool canNavigateForward) nothrowSets whether gestures and shortcuts for navigating forward are enabled.void setChildTransitionParams(adw.spring_params.SpringParams params) nothrowSets the child transition spring parameters for self.void setFoldThresholdPolicy(adw.types.FoldThresholdPolicy policy) nothrowSets the fold threshold policy for self.void setModeTransitionDuration(uint duration) nothrowSets the mode transition animation duration for self.void setTransitionType(adw.types.LeafletTransitionType transition) nothrowSets the type of animation used for transitions between modes and children.void setVisibleChild(gtk.widget.Widget visibleChild) nothrowSets the widget currently visible when the leaflet is folded.Fluent builder implementation template for adw.leaflet.Leaflet
T canNavigateBack(bool propval) nothrowSet `canNavigateBack` property. Params: propval = Whether gestures and shortcuts for navigating backward are enabled.T canNavigateForward(bool propval) nothrowSet `canNavigateForward` property. Params: propval = Whether gestures and shortcuts for navigating forward are enabled.T canUnfold(bool propval) nothrowSet `canUnfold` property. Params: propval = Whether or not the leaflet can unfold. Returns: Builder instance for fluent chainingT childTransitionParams(adw.spring_params.SpringParams propval) nothrowSet `childTransitionParams` property. Params: propval = The child transition spring parameters.T foldThresholdPolicy(adw.types.FoldThresholdPolicy propval) nothrowSet `foldThresholdPolicy` property. Params: propval = Determines when the leaflet will fold.T homogeneous(bool propval) nothrowSet `homogeneous` property. Params: propval = Whether the leaflet allocates the same size for all children when folded.T modeTransitionDuration(uint propval) nothrowSet `modeTransitionDuration` property. Params: propval = The mode transition animation duration, in milliseconds. Returns: Builder instance for fluent chainingT transitionType(adw.types.LeafletTransitionType propval) nothrowSet `transitionType` property. Params: propval = The type of animation used for transitions between modes and children.T visibleChild(gtk.widget.Widget propval) nothrowSet `visibleChild` property. Params: propval = The widget currently visible when the leaflet is folded.T visibleChildName(string propval) nothrowSet `visibleChildName` property. Params: propval = The name of the widget currently visible when the leaflet is folded.Fluent builder for adw.leaflet.Leaflet