Leaflet


Object Hierarchy:

Adw.Leaflet Adw.Leaflet Adw.Leaflet Gtk.Widget Gtk.Widget Gtk.Widget->Adw.Leaflet GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Adw.Leaflet Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Adw.Leaflet Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Adw.Leaflet Gtk.ConstraintTarget->Gtk.Widget Adw.Swipeable Adw.Swipeable Adw.Swipeable->Adw.Leaflet Gtk.Orientable Gtk.Orientable Gtk.Orientable->Adw.Leaflet

Description:

[ CCode ( type_id = "adw_leaflet_get_type ()" ) ]
[ Version ( deprecated = true , deprecated_since = "1.4" ) ]
public sealed class Leaflet : Widget, Swipeable, Accessible, Buildable, ConstraintTarget, Orientable

Warning: Leaflet is deprecated since 1.4.

An adaptive container acting like a box or a stack.

Note:

See [the migration guide](migrating-to-breakpoints.html#replace-adwleaflet)

<picture> <source srcset="leaflet-wide-dark.png" media="(prefers-color-scheme: dark)"> <img src="leaflet-wide.png" alt="leaflet-wide"> </picture> <picture> <source srcset="leaflet-narrow-dark.png" media="(prefers-color-scheme: dark)"> <img src="leaflet-narrow.png" alt="leaflet-narrow"> </picture>

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.


Namespace: Adw
Package: libadwaita-1

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from interface Adw.Swipeable
All known members inherited from interface Gtk.Orientable