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 ( since =
"1.0" ) ]
public sealed class Leaflet :
Widget ,
Swipeable ,
Accessible ,
Buildable ,
ConstraintTarget ,
Orientable
An adaptive container acting like a box or a stack.
<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 [[email protected] ] does or like a [[email protected] ] 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.
Content:
Properties:
public bool can_navigate_back { get ; set ; }
Whether gestures and shortcuts for navigating backward are enabled.
public bool can_navigate_forward { get ; set ; }
Whether gestures and shortcuts for navigating forward are enabled.
public bool can_unfold { get ; set ; }
Whether or not the leaflet can unfold.
public SpringParams child_transition_params { owned get ; set ; }
The child transition spring parameters.
public bool child_transition_running { get ; }
Whether a child transition is currently running.
public FoldThresholdPolicy fold_threshold_policy { get ; set ; }
Determines when the leaflet will fold.
public bool folded { get ; }
Whether the leaflet is folded.
public bool homogeneous { get ; set ; }
Whether the leaflet allocates the same size for all children when
folded.
public uint mode_transition_duration { get ; set ; }
The mode transition animation duration, in milliseconds.
public SelectionModel pages { owned get ; }
A selection model with the leaflet's pages.
public LeafletTransitionType transition_type { get ; set ; }
The type of animation used for transitions between modes and children.
public Widget visible_child { get ; set ; }
The widget currently visible when the leaflet is folded.
public string visible_child_name { get ; set ; }
The name of the widget currently visible when the leaflet is folded.
Creation methods:
Methods:
Inherited Members:
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface Adw.Swipeable
All known members inherited from interface Gtk.Accessible
accessible_role
get_accessible_role
reset_property
reset_relation
reset_state
update_property
update_property_value
update_relation
update_relation_value
update_state
update_state_value
All known members inherited from interface Gtk.Buildable
add_child
custom_finished
custom_tag_end
custom_tag_start
get_buildable_id
get_id
get_internal_child
parser_finished
set_buildable_property
set_id
All known members inherited from interface Gtk.Orientable