Adw.Leaflet
Description: Reference for Adw.Leaflet

### Class

# AdwLeaflet

#### Description [src]

    final class Adw.Leaflet : Gtk.Widget {
      /* No available fields */
    }

An adaptive container acting like a box or a stack.

The `AdwLeaflet` widget can display its children like a `GtkBox` does or like a `GtkStack` 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.

Available since: | 1.0

#### Hierarchy

#### Ancestors

- GtkWidget
- GInitiallyUnowned
- GObject

#### Implements

- AdwSwipeable
- GtkAccessible
- GtkBuildable
- GtkConstraintTarget
- GtkOrientable

#### Constructors

###### adw_leaflet_new

Creates a new `AdwLeaflet`.

Available since: 1.0

#### Instance methods

###### adw_leaflet_append

Adds a child to `self`.

Available since: 1.0

###### adw_leaflet_get_adjacent_child

Finds the previous or next navigatable child.

Available since: 1.0

###### adw_leaflet_get_can_swipe_back

Gets whether a swipe gesture can be used to navigate to the previous child.

Available since: 1.0

###### adw_leaflet_get_can_swipe_forward

Gets whether a swipe gesture can be used to navigate to the next child.

Available since: 1.0

###### adw_leaflet_get_can_unfold

Gets whether `self` can unfold.

Available since: 1.0

###### adw_leaflet_get_child_by_name

Finds the child of `self` with `name`.

Available since: 1.0

###### adw_leaflet_get_child_transition_duration

Gets the child transition animation duration for `self`.

Available since: 1.0

###### adw_leaflet_get_child_transition_running

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

Available since: 1.0

###### adw_leaflet_get_fold_threshold_policy

Gets the fold threshold policy for `self`.

Available since: 1.0

###### adw_leaflet_get_folded

Gets whether `self` is folded.

Available since: 1.0

###### adw_leaflet_get_homogeneous

Gets whether `self` is homogeneous for the given fold and orientation.

Available since: 1.0

###### adw_leaflet_get_interpolate_size

Gets whether the leaflet interpolates its size when changing the visible child.

Available since: 1.0

###### adw_leaflet_get_mode_transition_duration

Gets the mode transition animation duration for `self`.

Available since: 1.0

###### adw_leaflet_get_page

Returns the `AdwLeafletPage` object for `child`.

Available since: 1.0

###### adw_leaflet_get_pages

Returns a `GListModel` that contains the pages of the leaflet.

Available since: 1.0

###### adw_leaflet_get_transition_type

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

Available since: 1.0

###### adw_leaflet_get_visible_child

Gets the widget currently visible when the leaflet is folded.

Available since: 1.0

###### adw_leaflet_get_visible_child_name

Gets the name of the currently visible child widget.

Available since: 1.0

###### adw_leaflet_insert_child_after

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

Available since: 1.0

###### adw_leaflet_navigate

Navigates to the previous or next child.

Available since: 1.0

###### adw_leaflet_prepend

Inserts `child` at the first position in `self`.

Available since: 1.0

###### adw_leaflet_remove

Removes a child widget from `self`.

Available since: 1.0

###### adw_leaflet_reorder_child_after

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

Available since: 1.0

###### adw_leaflet_set_can_swipe_back

Sets whether a swipe gesture can be used to navigate to the previous child.

Available since: 1.0

###### adw_leaflet_set_can_swipe_forward

Sets whether a swipe gesture can be used to navigate to the next child.

Available since: 1.0

###### adw_leaflet_set_can_unfold

Sets whether `self` can unfold.

Available since: 1.0

###### adw_leaflet_set_child_transition_duration

Sets the child transition animation duration for `self`.

Available since: 1.0

###### adw_leaflet_set_fold_threshold_policy

Sets the fold threshold policy for `self`.

Available since: 1.0

###### adw_leaflet_set_homogeneous

Sets `self` to be homogeneous or not for the given fold and orientation.

Available since: 1.0

###### adw_leaflet_set_interpolate_size

Sets whether the leaflet interpolates its size when changing the visible child.

Available since: 1.0

###### adw_leaflet_set_mode_transition_duration

Sets the mode transition animation duration for `self`.

Available since: 1.0

###### adw_leaflet_set_transition_type

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

Available since: 1.0

###### adw_leaflet_set_visible_child

Sets the widget currently visible when the leaflet is folded.

Available since: 1.0

###### adw_leaflet_set_visible_child_name

Makes the child with the name `name` visible.

Available since: 1.0

##### Methods inherited from AdwSwipeable (5)

###### adw_swipeable_get_cancel_progress

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

Available since: 1.0

###### adw_swipeable_get_distance

Gets the swipe distance of `self`.

Available since: 1.0

###### adw_swipeable_get_progress

Gets the current progress of `self`.

Available since: 1.0

###### adw_swipeable_get_snap_points

Gets the snap points of `self`.

Available since: 1.0

###### adw_swipeable_get_swipe_area

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

Available since: 1.0

#### Properties

###### Adw.Leaflet:can-swipe-back

Whether a swipe gesture can be used to navigate to the previous child.

Available since: 1.0

###### Adw.Leaflet:can-swipe-forward

Whether a swipe gesture can be used to navigate to the next child.

Available since: 1.0

###### Adw.Leaflet:can-unfold

Whether or not the leaflet can unfold.

Available since: 1.0

###### Adw.Leaflet:child-transition-duration

The child transition animation duration, in milliseconds.

Available since: 1.0

###### Adw.Leaflet:child-transition-running

Whether a child transition is currently running.

Available since: 1.0

###### Adw.Leaflet:fold-threshold-policy

Determines when the leaflet will fold.

Available since: 1.0

###### Adw.Leaflet:folded

Whether the leaflet is folded.

Available since: 1.0

###### Adw.Leaflet:hhomogeneous-folded

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

Available since: 1.0

###### Adw.Leaflet:hhomogeneous-unfolded

Whether the leaflet allocates the same width for all children when unfolded.

Available since: 1.0

###### Adw.Leaflet:interpolate-size

Whether the leaflet interpolates its size when changing the visible child.

Available since: 1.0

###### Adw.Leaflet:mode-transition-duration

The mode transition animation duration, in milliseconds.

Available since: 1.0

###### Adw.Leaflet:pages

A selection model with the leaflet’s pages.

Available since: 1.0

###### Adw.Leaflet:transition-type

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

Available since: 1.0

###### Adw.Leaflet:vhomogeneous-folded

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

Available since: 1.0

###### Adw.Leaflet:vhomogeneous-unfolded

Whether the leaflet allocates the same height for all children when unfolded.

Available since: 1.0

###### Adw.Leaflet:visible-child

The widget currently visible when the leaflet is folded.

Available since: 1.0

###### Adw.Leaflet:visible-child-name

The name of the widget currently visible when the leaflet is folded.

Available since: 1.0

#### Class structure

    struct AdwLeafletClass {
      GtkWidgetClass parent_class;

    }

###### Class members

`parent_class` |
    GtkWidgetClass
| No description available.