Leaflet
Object Hierarchy:
Description:
[ Version ( since = "1.0" ) ]
public class Leaflet : Container, Implementor, Buildable, Orientable, Swipeable
An adaptive container acting like a box or a stack.
The `HdyLeaflet` 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.
The “over” and “under” transitions can draw their shadow on top of the window's transparent areas, like the rounded corners. This is a side-effect of allowing shadows to be drawn on top of OpenGL areas. It can be mitigated by using [class@Window] or [class@ApplicationWindow] as they will crop anything drawn beyond the rounded corners.
The child property `navigatable` can be set on `HdyLeaflet` children to determine whether they can be navigated to when folded. If `FALSE`, the child will be ignored by [method@Leaflet.get_adjacent_child], [method@Leaflet.navigate], and swipe gestures. This can be used used to prevent switching to widgets like separators.
CSS nodes
`HdyLeaflet` 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 didn't compute its fold yet.