HdyDeck

HdyDeck — A swipeable widget showing one of the visible children at a time.

Functions

Properties

Types and Values

Object Hierarchy

    GEnum
    ╰── HdyDeckTransitionType
    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── HdyDeck

Implemented Interfaces

HdyDeck implements AtkImplementorIface, GtkBuildable, GtkOrientable and HdySwipeable.

Description

The HdyDeck widget displays one of the visible children, similar to a GtkStack. The children are strictly ordered and can be navigated using swipe gestures.

CSS nodes

HdyDeck has a single CSS node with name deck.

Functions

hdy_deck_new ()

GtkWidget *
hdy_deck_new (void);

hdy_deck_get_visible_child ()

GtkWidget *
hdy_deck_get_visible_child (HdyDeck *self);

Gets the visible child widget.

Parameters

self

a HdyDeck

 

Returns

the visible child widget.

[transfer none]

Since: 1.0


hdy_deck_set_visible_child ()

void
hdy_deck_set_visible_child (HdyDeck *self,
                            GtkWidget *visible_child);

Makes visible_child visible using a transition determined by HdyDeck:transition-type and HdyDeck:transition-duration. The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.

Parameters

self

a HdyDeck

 

visible_child

the new child

 

Since: 1.0


hdy_deck_get_visible_child_name ()

const gchar *
hdy_deck_get_visible_child_name (HdyDeck *self);

Gets the name of the currently visible child widget.

Parameters

self

a HdyDeck

 

Returns

the name of the visible child.

[transfer none]

Since: 1.0


hdy_deck_set_visible_child_name ()

void
hdy_deck_set_visible_child_name (HdyDeck *self,
                                 const gchar *name);

Makes the child with the name name visible.

See hdy_deck_set_visible_child() for more details.

Parameters

self

a HdyDeck

 

name

the name of a child

 

Since: 1.0


hdy_deck_get_homogeneous ()

gboolean
hdy_deck_get_homogeneous (HdyDeck *self,
                          GtkOrientation orientation);

Gets whether self is homogeneous for the given orientation. See hdy_deck_set_homogeneous().

Parameters

self

a HdyDeck

 

orientation

the orientation

 

Returns

whether self is homogeneous for the given orientation.

Since: 1.0


hdy_deck_set_homogeneous ()

void
hdy_deck_set_homogeneous (HdyDeck *self,
                          GtkOrientation orientation,
                          gboolean homogeneous);

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

Parameters

self

a HdyDeck

 

orientation

the orientation

 

homogeneous

TRUE to make self homogeneous

 

Since: 1.0


hdy_deck_get_transition_type ()

HdyDeckTransitionType
hdy_deck_get_transition_type (HdyDeck *self);

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

Parameters

self

a HdyDeck

 

Returns

the current transition type of self

Since: 1.0


hdy_deck_set_transition_type ()

void
hdy_deck_set_transition_type (HdyDeck *self,
                              HdyDeckTransitionType 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 child that is about to become current.

Parameters

self

a HdyDeck

 

transition

the new transition type

 

Since: 1.0


hdy_deck_get_transition_duration ()

guint
hdy_deck_get_transition_duration (HdyDeck *self);

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

Parameters

self

a HdyDeck

 

Returns

the child transition duration

Since: 1.0


hdy_deck_set_transition_duration ()

void
hdy_deck_set_transition_duration (HdyDeck *self,
                                  guint duration);

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

Parameters

self

a HdyDeck

 

duration

the new duration, in milliseconds

 

Since: 1.0


hdy_deck_get_transition_running ()

gboolean
hdy_deck_get_transition_running (HdyDeck *self);

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

Parameters

self

a HdyDeck

 

Returns

TRUE if the transition is currently running, FALSE otherwise.

Since: 1.0


hdy_deck_get_interpolate_size ()

gboolean
hdy_deck_get_interpolate_size (HdyDeck *self);

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

Parameters

self

a HdyDeck

 

Returns

TRUE if child sizes are interpolated

Since: 1.0


hdy_deck_set_interpolate_size ()

void
hdy_deck_set_interpolate_size (HdyDeck *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, self 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 HdyDeck

 

interpolate_size

the new value

 

Since: 1.0


hdy_deck_get_can_swipe_back ()

gboolean
hdy_deck_get_can_swipe_back (HdyDeck *self);

Returns whether the HdyDeck allows swiping to the previous child.

Parameters

self

a HdyDeck

 

Returns

TRUE if back swipe is enabled.

Since: 1.0


hdy_deck_set_can_swipe_back ()

void
hdy_deck_set_can_swipe_back (HdyDeck *self,
                             gboolean can_swipe_back);

Sets whether or not self allows switching to the previous child via a swipe gesture.

Parameters

self

a HdyDeck

 

can_swipe_back

the new value

 

Since: 1.0


hdy_deck_get_can_swipe_forward ()

gboolean
hdy_deck_get_can_swipe_forward (HdyDeck *self);

Returns whether the HdyDeck allows swiping to the next child.

Parameters

self

a HdyDeck

 

Returns

TRUE if forward swipe is enabled.

Since: 1.0


hdy_deck_set_can_swipe_forward ()

void
hdy_deck_set_can_swipe_forward (HdyDeck *self,
                                gboolean can_swipe_forward);

Sets whether or not self allows switching to the next child via a swipe gesture.

Parameters

self

a HdyDeck

 

can_swipe_forward

the new value

 

Since: 1.0


hdy_deck_navigate ()

gboolean
hdy_deck_navigate (HdyDeck *self,
                   HdyNavigationDirection direction);

Switches to the previous or next child, similar to performing a swipe gesture to go in direction .

Parameters

self

a HdyDeck

 

direction

the direction

 

Returns

TRUE if visible child was changed, FALSE otherwise.

Since: 1.0

Types and Values

HDY_TYPE_DECK

#define HDY_TYPE_DECK (hdy_deck_get_type())

enum HdyDeckTransitionType

This enumeration value describes the possible transitions between children in a HdyDeck widget.

New values may be added to this enumeration over time.

Members

HDY_DECK_TRANSITION_TYPE_NONE

No transition

 

HDY_DECK_TRANSITION_TYPE_SLIDE

Slide from left, right, up or down according to the orientation, text direction and the children order

 

HDY_DECK_TRANSITION_TYPE_OVER

Cover the old page or uncover the new page, sliding from or towards the end according to orientation, text direction and children order

 

HDY_DECK_TRANSITION_TYPE_UNDER

Uncover the new page or cover the old page, sliding from or towards the start according to orientation, text direction and children order

 

Since: 1.0


struct HdyDeckClass

struct HdyDeckClass {
  GtkContainerClass parent_class;
};

Members


HdyDeck

typedef struct _HdyDeck HdyDeck;

Property Details

The “can-swipe-back” property

  “can-swipe-back”           gboolean

Whether or not self allows switching to the previous child via a swipe gesture.

Owner: HdyDeck

Flags: Read / Write

Default value: FALSE

Since: 1.0


The “can-swipe-forward” property

  “can-swipe-forward”        gboolean

Whether or not self allows switching to the next child via a swipe gesture.

Owner: HdyDeck

Flags: Read / Write

Default value: FALSE

Since: 1.0


The “hhomogeneous” property

  “hhomogeneous”             gboolean

Horizontally homogeneous sizing.

Owner: HdyDeck

Flags: Read / Write

Default value: TRUE

Since: 1.0


The “interpolate-size” property

  “interpolate-size”         gboolean

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

Owner: HdyDeck

Flags: Read / Write

Default value: FALSE

Since: 1.0


The “transition-duration” property

  “transition-duration”      guint

The transition animation duration, in milliseconds.

Owner: HdyDeck

Flags: Read / Write

Default value: 200

Since: 1.0


The “transition-running” property

  “transition-running”       gboolean

Whether or not the transition is currently running.

Owner: HdyDeck

Flags: Read

Default value: FALSE

Since: 1.0


The “transition-type” property

  “transition-type”          HdyDeckTransitionType

The type of animation that will be used for transitions between children.

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

Owner: HdyDeck

Flags: Read / Write

Default value: HDY_DECK_TRANSITION_TYPE_NONE

Since: 1.0


The “vhomogeneous” property

  “vhomogeneous”             gboolean

Vertically homogeneous sizing.

Owner: HdyDeck

Flags: Read / Write

Default value: TRUE

Since: 1.0


The “visible-child” property

  “visible-child”            GtkWidget *

The widget currently visible.

Owner: HdyDeck

Flags: Read / Write

Since: 1.0


The “visible-child-name” property

  “visible-child-name”       gchar *

The name of the widget currently visible.

Owner: HdyDeck

Flags: Read / Write

Default value: NULL

Since: 1.0