Leaflet
Object Hierarchy:
Hdy.Leaflet
Hdy.Leaflet
Hdy.Leaflet
Gtk.Container
Gtk.Container
Gtk.Container->Hdy.Leaflet
Gtk.Widget
Gtk.Widget
Gtk.Widget->Gtk.Container
GLib.InitiallyUnowned
GLib.InitiallyUnowned
GLib.InitiallyUnowned->Gtk.Widget
GLib.Object
GLib.Object
GLib.Object->GLib.InitiallyUnowned
Atk.Implementor
Atk.Implementor
Atk.Implementor->Hdy.Leaflet
Atk.Implementor->Gtk.Container
Atk.Implementor->Gtk.Widget
Gtk.Buildable
Gtk.Buildable
Gtk.Buildable->Hdy.Leaflet
Gtk.Buildable->Gtk.Container
Gtk.Buildable->Gtk.Widget
Gtk.Orientable
Gtk.Orientable
Gtk.Orientable->Hdy.Leaflet
Hdy.Swipeable
Hdy.Swipeable
Hdy.Swipeable->Hdy.Leaflet
Description:
[
CCode ( type_id =
"hdy_leaflet_get_type ()" ) ]
[
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 [[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.
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 [[email protected] _adjacent_child], [[email protected] ], 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.
Content:
Properties:
public bool can_swipe_back { get ; set ; }
Whether swipe gestures allow switching to the previous navigatable
child.
public bool can_swipe_forward { get ; set ; }
Whether swipe gestures allow switching to the next navigatable child.
public uint child_transition_duration { get ; set ; }
The child transition animation duration, in milliseconds.
public bool child_transition_running { get ; }
Whether a child transition is currently running.
public bool folded { get ; }
Whether the leaflet is folded.
public bool hhomogeneous_folded { get ; set ; }
Whether to allocate the same width for all children when folded.
public bool hhomogeneous_unfolded { get ; set ; }
Whether to allocate the same width for all children when unfolded.
public bool interpolate_size { get ; set ; }
Whether the size should smoothly change when changing between
children.
public uint mode_transition_duration { get ; set ; }
The mode transition animation duration, in milliseconds.
public LeafletTransitionType transition_type { get ; set ; }
The animation type used for transitions between modes and children.
public bool vhomogeneous_folded { get ; set ; }
Whether to allocates the same height for all children when folded.
public bool vhomogeneous_unfolded { get ; set ; }
Whether to allocate the same height for all children when unfolded.
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:
public unowned Widget ? get_adjacent_child (NavigationDirection direction)
Finds the previous or next navigatable child.
public bool get_can_swipe_back ()
Gets whether swipe gestures switch to the previous navigatable child.
public bool get_can_swipe_forward ()
Gets whether swipe gestures switch to the next navigatable child.
public unowned Widget ? get_child_by_name (string name)
Finds the child of this with the
name given as the argument.
public uint get_child_transition_duration ()
Gets the amount of time that transitions between children will take.
public bool get_child_transition_running ()
Returns whether this is currently in
a transition from one page to another.
public bool get_folded ()
Gets whether this is folded.
public bool get_homogeneous (bool folded, Orientation orientation)
Gets whether this is homogeneous for
the given fold and orientation.
public bool get_interpolate_size ()
Gets whether to interpolate between the sizes of children on page
switches.
public uint get_mode_transition_duration ()
Gets the amount of time that transitions between modes in
this will take.
public LeafletTransitionType get_transition_type ()
Gets the animation type that will be used for transitions between
modes and children.
public unowned Widget get_visible_child ()
Gets the visible child widget.
public unowned string get_visible_child_name ()
Gets the name of the currently visible child widget.
public void insert_child_after (Widget child, Widget ? sibling)
Inserts child
in the position after sibling
in the list of children.
public bool navigate (NavigationDirection direction)
Navigates to the previous or next navigatable child.
public void prepend (Widget child)
Inserts child
at the first position in
this .
public void reorder_child_after (Widget child, Widget ? sibling)
Moves child
to the position after sibling
in
the list of children.
public void set_can_swipe_back (bool can_swipe_back)
Sets whether swipe gestures switch to the previous navigatable child.
public void set_can_swipe_forward (bool can_swipe_forward)
Sets whether swipe gestures switch to the next navigatable child.
public void set_child_transition_duration (uint duration)
Sets the duration that transitions between children in
this will take.
public void set_homogeneous (bool folded, Orientation orientation, bool homogeneous)
Sets whether to be homogeneous for the given fold and orientation.
public void set_interpolate_size (bool interpolate_size)
Sets whether this will interpolate
its size when changing the visible child.
public void set_mode_transition_duration (uint duration)
Sets the duration that transitions between modes in
this will take.
public void set_transition_type (LeafletTransitionType transition)
Sets the animation type that will be used for transitions between
modes and children.
public void set_visible_child (Widget visible_child)
Sets the currently visible widget when the leaflet is folded.
public void set_visible_child_name (string name)
Makes the child with the name name
visible.
Inherited Members:
All known members inherited from class Gtk.Container
@foreach
add
add_with_properties
border_width
check_resize
child
child_get
child_get_property
child_get_valist
child_notify
child_notify_by_pspec
child_set
child_set_property
child_set_valist
child_type
class_find_child_property
class_list_child_properties
composite_name
find_child_property
forall
forall_internal
get_border_width
get_child_property
get_children
get_focus_chain
get_focus_child
get_focus_hadjustment
get_focus_vadjustment
get_path_for_child
get_resize_mode
handle_border_width
install_child_properties
install_child_property
list_child_properties
propagate_draw
remove
resize_children
resize_mode
set_border_width
set_child_property
set_focus_chain
set_focus_child
set_focus_hadjustment
set_focus_vadjustment
set_reallocate_redraws
set_resize_mode
unset_focus_chain
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 Atk.Implementor
All known members inherited from interface Gtk.Buildable
add_child
construct_child
custom_finished
custom_tag_end
custom_tag_start
get_internal_child
get_name
parser_finished
set_buildable_property
set_name
All known members inherited from interface Gtk.Orientable
All known members inherited from interface Hdy.Swipeable