## HdyLeaflet HdyLeaflet — An adaptive container acting like a box or a stack. |

## Functions

GtkWidget * | hdy_leaflet_new ()
HdyFold | hdy_leaflet_get_fold ()
GtkWidget * | hdy_leaflet_get_visible_child ()
void | hdy_leaflet_set_visible_child ()
const gchar * | hdy_leaflet_get_visible_child_name ()
void | hdy_leaflet_set_visible_child_name ()
gboolean | hdy_leaflet_get_homogeneous ()
void | hdy_leaflet_set_homogeneous ()
HdyLeafletModeTransitionType | hdy_leaflet_get_mode_transition_type ()
void | hdy_leaflet_set_mode_transition_type ()
guint | hdy_leaflet_get_mode_transition_duration ()
void | hdy_leaflet_set_mode_transition_duration ()
HdyLeafletChildTransitionType | hdy_leaflet_get_child_transition_type ()
void | hdy_leaflet_set_child_transition_type ()
guint | hdy_leaflet_get_child_transition_duration ()
void | hdy_leaflet_set_child_transition_duration ()
gboolean | hdy_leaflet_get_child_transition_running ()
gboolean | hdy_leaflet_get_interpolate_size ()
void | hdy_leaflet_set_interpolate_size ()

## Properties

guint | child-transition-duration | Read / Write
gboolean | child-transition-running | Read
HdyLeafletChildTransitionType | child-transition-type | Read / Write
HdyFold | fold | Read
gboolean | folded | Read
gboolean | hhomogeneous-folded | Read / Write
gboolean | hhomogeneous-unfolded | Read / Write
gboolean | interpolate-size | Read / Write
guint | mode-transition-duration | Read / Write
HdyLeafletModeTransitionType | mode-transition-type | Read / Write
gboolean | vhomogeneous-folded | Read / Write
gboolean | vhomogeneous-unfolded | Read / Write
GtkWidget * | visible-child | Read / Write
gchar * | visible-child-name | Read / Write

## Types and Values

#define | HDY_TYPE_LEAFLET
enum | HdyLeafletModeTransitionType
enum | HdyLeafletChildTransitionType
struct | HdyLeafletClass
| HdyLeaflet

## Object Hierarchy

        GEnum
        ├── HdyLeafletChildTransitionType
        ╰── HdyLeafletModeTransitionType
        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── HdyLeaflet

## Implemented Interfaces

HdyLeaflet implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Description

The HdyLeaflet widget can display its children like a GtkBox does or like a HdyLeaflet 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. The threshold is dictated by the preferred minimum sizes of the children.

## Functions

### hdy_leaflet_new ()

    GtkWidget *
    hdy_leaflet_new (void);

### hdy_leaflet_get_fold ()

    HdyFold
    hdy_leaflet_get_fold (HdyLeaflet *self);

Gets the fold of `self` .

#### Parameters

self | a HdyLeaflet |

#### Returns

the fold of `self` .

### hdy_leaflet_get_visible_child ()

    GtkWidget *
    hdy_leaflet_get_visible_child (HdyLeaflet *self);

Get the visible child widget.

#### Parameters

self | a HdyLeaflet |

#### Returns

the visible child widget.

[transfer none]

### hdy_leaflet_set_visible_child ()

    void
    hdy_leaflet_set_visible_child (HdyLeaflet *self,
                                   GtkWidget *visible_child);

### hdy_leaflet_get_visible_child_name ()

    const gchar *
    hdy_leaflet_get_visible_child_name (HdyLeaflet *self);

### hdy_leaflet_set_visible_child_name ()

    void
    hdy_leaflet_set_visible_child_name (HdyLeaflet *self,
                                        const gchar *name);

### hdy_leaflet_get_homogeneous ()

    gboolean
    hdy_leaflet_get_homogeneous (HdyLeaflet *self,
                                 HdyFold fold,
                                 GtkOrientation orientation);

Gets whether `self` is homogeneous for the given fold and orientation. See `hdy_leaflet_set_homogeneous()`.

#### Parameters

self | a HdyLeaflet |
fold | the fold |
orientation | the orientation |

#### Returns

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

### hdy_leaflet_set_homogeneous ()

    void
    hdy_leaflet_set_homogeneous (HdyLeaflet *self,
                                 HdyFold fold,
                                 GtkOrientation orientation,
                                 gboolean homogeneous);

Sets the HdyLeaflet to be homogeneous or not for the given fold and orientation. If it is homogeneous, the HdyLeaflet will request the same width or height for all its children depending on the orientation. If it isn't and it is folded, the leaflet may change width or height when a different child becomes visible.

#### Parameters

self | a HdyLeaflet |
fold | the fold |
orientation | the orientation |
homogeneous | `TRUE` to make `self` homogeneous |

### hdy_leaflet_get_mode_transition_type ()

    HdyLeafletModeTransitionType
    hdy_leaflet_get_mode_transition_type (HdyLeaflet *self);

Gets the type of animation that will be used for transitions between modes in `self` .

#### Parameters

self | a HdyLeaflet |

#### Returns

the current mode transition type of `self`

### hdy_leaflet_set_mode_transition_type ()

    void
    hdy_leaflet_set_mode_transition_type (HdyLeaflet *self,
                                          HdyLeafletModeTransitionType transition);

Sets the type of animation that will be used for transitions between modes in `self` .

The transition type can be changed without problems at runtime, so it is possible to change the animation based on the mode that is about to become current.

#### Parameters

self | a HdyLeaflet |
transition | the new transition type |

### hdy_leaflet_get_mode_transition_duration ()

    guint
    hdy_leaflet_get_mode_transition_duration
                                   (HdyLeaflet *self);

Returns the amount of time (in milliseconds) that transitions between modes in `self` will take.

#### Parameters

self | a HdyLeaflet |

#### Returns

the mode transition duration

### hdy_leaflet_set_mode_transition_duration ()

    void
    hdy_leaflet_set_mode_transition_duration
                                   (HdyLeaflet *self,
                                    guint duration);

Sets the duration that transitions between modes in `self` will take.

#### Parameters

self | a HdyLeaflet |
duration | the new duration, in milliseconds |

### hdy_leaflet_get_child_transition_type ()

    HdyLeafletChildTransitionType
    hdy_leaflet_get_child_transition_type (HdyLeaflet *self);

Gets the type of animation that will be used for transitions between modes in `self` .

#### Parameters

self | a HdyLeaflet |

#### Returns

the current mode transition type of `self`

### hdy_leaflet_set_child_transition_type ()

    void
    hdy_leaflet_set_child_transition_type (HdyLeaflet *self,
                                           HdyLeafletChildTransitionType transition);

Sets the type of animation that will be used for transitions between children in `self` .

The transition type can be changed without problems at runtime, so it is possible to change the animation based on the mode that is about to become current.

#### Parameters

self | a HdyLeaflet |
transition | the new transition type |

### hdy_leaflet_get_child_transition_duration ()

    guint
    hdy_leaflet_get_child_transition_duration
                                   (HdyLeaflet *self);

Returns the amount of time (in milliseconds) that transitions between children in `self` will take.

#### Parameters

self | a HdyLeaflet |

#### Returns

the mode transition duration

### hdy_leaflet_set_child_transition_duration ()

    void
    hdy_leaflet_set_child_transition_duration
                                   (HdyLeaflet *self,
                                    guint duration);

Sets the duration that transitions between children in `self` will take.

#### Parameters

self | a HdyLeaflet |
duration | the new duration, in milliseconds |

### hdy_leaflet_get_child_transition_running ()

    gboolean
    hdy_leaflet_get_child_transition_running
                                   (HdyLeaflet *self);

Returns whether `self` is currently in a transition from one page to another.

#### Parameters

self | a HdyLeaflet |

#### Returns

`TRUE` if the transition is currently running, `FALSE` otherwise.

### hdy_leaflet_get_interpolate_size ()

    gboolean
    hdy_leaflet_get_interpolate_size (HdyLeaflet *self);

Returns wether the HdyLeaflet is set up to interpolate between the sizes of children on page switch.

#### Parameters

self | a HdyLeaflet |

#### Returns

`TRUE` if child sizes are interpolated

### hdy_leaflet_set_interpolate_size ()

    void
    hdy_leaflet_set_interpolate_size (HdyLeaflet *self,
                                      gboolean interpolate_size);

Sets whether or not `self` will interpolate its size when changing the visible child. If the “interpolate-size” property is set to `TRUE`, `stack` will interpolate its size between the current one and the one it'll take after changing the visible child, according to the set transition duration.

#### Parameters

self | a HdyLeaflet |
interpolate_size | the new value |

## Types and Values

### HDY_TYPE_LEAFLET

    #define HDY_TYPE_LEAFLET (hdy_leaflet_get_type())

### enum HdyLeafletModeTransitionType

These enumeration values describe the possible transitions between pages in a HdyLeaflet widget.

New values may be added to this enumeration over time.

#### Members

HDY_LEAFLET_MODE_TRANSITION_TYPE_NONE | No transition |
HDY_LEAFLET_MODE_TRANSITION_TYPE_SLIDE | Slide from left, right, up or down according to the orientation, text direction and the children order |

### enum HdyLeafletChildTransitionType

These enumeration values describe the possible transitions between pages in a HdyLeaflet widget.

New values may be added to this enumeration over time.

#### Members

HDY_LEAFLET_CHILD_TRANSITION_TYPE_NONE | No transition |
HDY_LEAFLET_CHILD_TRANSITION_TYPE_CROSSFADE | A cross-fade |
HDY_LEAFLET_CHILD_TRANSITION_TYPE_SLIDE | Slide from left, right, up or down according to orientation, text direction and order |
HDY_LEAFLET_CHILD_TRANSITION_TYPE_OVER | Cover the old page or uncover the new page, sliding according to orientation, text direction and order |

### struct HdyLeafletClass

    struct HdyLeafletClass {
      GtkContainerClass parent_class;
    };

#### Members

### HdyLeaflet

    typedef struct _HdyLeaflet HdyLeaflet;

## Property Details

### The `“child-transition-duration”` property

      “child-transition-duration” guint

The child transition animation duration, in milliseconds.

Flags: Read / Write

Default value: 200

### The `“child-transition-running”` property

      “child-transition-running” gboolean

Whether or not the child transition is currently running.

Flags: Read

Default value: FALSE

### The `“child-transition-type”` property

      “child-transition-type”    HdyLeafletChildTransitionType

The type of animation used to transition between children.

Flags: Read / Write

Default value: HDY_LEAFLET_CHILD_TRANSITION_TYPE_NONE

### The `“fold”` property

      “fold”                     HdyFold

The fold of the leaflet.

The leaflet will be folded if the size allocated to it is smaller than the sum of the natural size of its children, it will be unfolded otherwise.

See also: “folded”.

Flags: Read

Default value: HDY_FOLD_UNFOLDED

### The `“folded”` property

      “folded”                   gboolean

`TRUE` if the leaflet is folded.

This is similar to the “fold” property but expressed as a gboolean rather than a GEnum. This makes it convenient to bind the “fold” of a leaflet to any other gboolean property of other GObject's using ``g_object_bind_property()``.

Flags: Read

Default value: FALSE

### The `“hhomogeneous-folded”` property

      “hhomogeneous-folded”      gboolean

Horizontally homogeneous sizing when the leaflet is folded.

Flags: Read / Write

Default value: TRUE

### The `“hhomogeneous-unfolded”` property

      “hhomogeneous-unfolded”    gboolean

Horizontally homogeneous sizing when the leaflet is unfolded.

Flags: Read / Write

Default value: FALSE

### The `“interpolate-size”` property

      “interpolate-size”         gboolean

Whether or not the size should smoothly change when changing between differently sized children.

Flags: Read / Write

Default value: FALSE

### The `“mode-transition-duration”` property

      “mode-transition-duration” guint

The mode transition animation duration, in milliseconds.

Flags: Read / Write

Default value: 250

### The `“mode-transition-type”` property

      “mode-transition-type”     HdyLeafletModeTransitionType

The type of animation used to transition between modes.

Flags: Read / Write

Default value: HDY_LEAFLET_MODE_TRANSITION_TYPE_NONE

### The `“vhomogeneous-folded”` property

      “vhomogeneous-folded”      gboolean

Vertically homogeneous sizing when the leaflet is folded.

Flags: Read / Write

Default value: TRUE

### The `“vhomogeneous-unfolded”` property

      “vhomogeneous-unfolded”    gboolean

Vertically homogeneous sizing when the leaflet is unfolded.

Flags: Read / Write

Default value: FALSE

### The `“visible-child”` property

      “visible-child”            GtkWidget *

The widget currently visible when the leaflet is folded.

Flags: Read / Write

### The `“visible-child-name”` property

      “visible-child-name”       gchar *

The name of the widget currently visible when the children are stacked.

Flags: Read / Write

Default value: NULL