adw-flap

adw-flap

Functions

Properties

GtkWidget * content Read / Write
GtkWidget * flap Read / Write
GtkPackType flap-position Read / Write
guint fold-duration Read / Write
AdwFlapFoldPolicy fold-policy Read / Write
gboolean folded Read
gboolean locked Read / Write
gboolean modal Read / Write
guint reveal-duration Read / Write
gboolean reveal-flap Read / Write
double reveal-progress Read
GtkWidget * separator Read / Write
gboolean swipe-to-close Read / Write
gboolean swipe-to-open Read / Write
AdwFlapTransitionType transition-type Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── AdwFlap

Implemented Interfaces

AdwFlap implements GtkAccessible, GtkBuildable, GtkConstraintTarget, GtkOrientable and AdwSwipeable.

Description

Functions

adw_flap_new ()

GtkWidget *
adw_flap_new (void);

Creates a new AdwFlap.

Returns

a new AdwFlap

Since: 1.0


adw_flap_get_content ()

GtkWidget *
adw_flap_get_content (AdwFlap *self);

Gets the content widget for self

Parameters

self

a AdwFlap

 

Returns

the content widget for self .

[transfer none][nullable]

Since: 1.0


adw_flap_set_content ()

void
adw_flap_set_content (AdwFlap *self,
                      GtkWidget *content);

Sets the content widget for self , always displayed when unfolded, and partially visible when folded.

Parameters

self

a AdwFlap

 

content

the content widget, or NULL.

[nullable]

Since: 1.0


adw_flap_get_flap ()

GtkWidget *
adw_flap_get_flap (AdwFlap *self);

Gets the flap widget for self

Parameters

self

a AdwFlap

 

Returns

the flap widget for self .

[transfer none][nullable]

Since: 1.0


adw_flap_set_flap ()

void
adw_flap_set_flap (AdwFlap *self,
                   GtkWidget *flap);

Sets the flap widget for self , only visible when “reveal-progress” is greater than 0.

Parameters

self

a AdwFlap

 

flap

the flap widget, or NULL.

[nullable]

Since: 1.0


adw_flap_get_separator ()

GtkWidget *
adw_flap_get_separator (AdwFlap *self);

Gets the separator widget for self .

Parameters

self

a AdwFlap

 

Returns

the separator widget for self .

[transfer none][nullable]

Since: 1.0


adw_flap_set_separator ()

void
adw_flap_set_separator (AdwFlap *self,
                        GtkWidget *separator);

Sets the separator widget for self , displayed between content and flap when there's no shadow to display. When exactly it's visible depends on the “transition-type” value. If NULL, no separator will be used.

Parameters

self

a AdwFlap

 

separator

the separator widget, or NULL.

[nullable]

Since: 1.0


adw_flap_get_flap_position ()

GtkPackType
adw_flap_get_flap_position (AdwFlap *self);

Gets the flap position for self .

Parameters

self

a AdwFlap

 

Returns

the flap position for self

Since: 1.0


adw_flap_set_flap_position ()

void
adw_flap_set_flap_position (AdwFlap *self,
                            GtkPackType position);

Sets the flap position for self . If GTK_PACK_START , the flap is displayed before the content, if GTK_PACK_END , it's displayed after the content.

Parameters

self

a AdwFlap

 

position

the new value

 

Since: 1.0


adw_flap_get_reveal_flap ()

gboolean
adw_flap_get_reveal_flap (AdwFlap *self);

Gets whether the flap widget is revealed for self .

Parameters

self

a AdwFlap

 

Returns

TRUE if the flap widget is revealed, FALSE otherwise.

Since: 1.0


adw_flap_set_reveal_flap ()

void
adw_flap_set_reveal_flap (AdwFlap *self,
                          gboolean reveal_flap);

Sets whether the flap widget is revealed for self .

Parameters

self

a AdwFlap

 

reveal_flap

TRUE to reveal the flap widget, FALSE otherwise

 

Since: 1.0


adw_flap_get_reveal_duration ()

guint
adw_flap_get_reveal_duration (AdwFlap *self);

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

Parameters

self

a AdwFlap

 

Returns

the reveal transition duration

Since: 1.0


adw_flap_set_reveal_duration ()

void
adw_flap_set_reveal_duration (AdwFlap *self,
                              guint duration);

Sets the duration that reveal transitions in self will take.

Parameters

self

a AdwFlap

 

duration

the new duration, in milliseconds

 

Since: 1.0


adw_flap_get_reveal_progress ()

double
adw_flap_get_reveal_progress (AdwFlap *self);

Gets the current reveal transition progress for self . 0 means fully hidden, 1 means fully revealed. See “reveal-flap”.

Parameters

self

a AdwFlap

 

Returns

the current reveal progress for self

Since: 1.0


adw_flap_get_fold_policy ()

AdwFlapFoldPolicy
adw_flap_get_fold_policy (AdwFlap *self);

Gets the current fold policy of self . See adw_flap_set_fold_policy().

Parameters

self

a AdwFlap

 

Returns

the current fold policy of self

Since: 1.0


adw_flap_set_fold_policy ()

void
adw_flap_set_fold_policy (AdwFlap *self,
                          AdwFlapFoldPolicy policy);

Sets the current fold policy for self . See AdwFlapFoldPolicy for available policies.

Parameters

self

a AdwFlap

 

policy

Fold policy

 

Since: 1.0


adw_flap_get_fold_duration ()

guint
adw_flap_get_fold_duration (AdwFlap *self);

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

Parameters

self

a AdwFlap

 

Returns

the fold transition duration

Since: 1.0


adw_flap_set_fold_duration ()

void
adw_flap_set_fold_duration (AdwFlap *self,
                            guint duration);

Sets the duration that fold transitions in self will take.

Parameters

self

a AdwFlap

 

duration

the new duration, in milliseconds

 

Since: 1.0


adw_flap_get_folded ()

gboolean
adw_flap_get_folded (AdwFlap *self);

Gets whether self is currently folded.

See “fold-policy”.

Parameters

self

a AdwFlap

 

Returns

TRUE if self is currently folded, FALSE otherwise

Since: 1.0


adw_flap_get_locked ()

gboolean
adw_flap_get_locked (AdwFlap *self);

Gets whether self is locked.

Parameters

self

a AdwFlap

 

Returns

TRUE if self is locked, FALSE otherwise

Since: 1.0


adw_flap_set_locked ()

void
adw_flap_set_locked (AdwFlap *self,
                     gboolean locked);

Sets whether self is locked.

If FALSE, folding self when the flap is revealed automatically closes it, and unfolding it when the flap is not revealed opens it. If TRUE, “reveal-flap” value never changes on its own.

Parameters

self

a AdwFlap

 

locked

the new value

 

Since: 1.0


adw_flap_get_transition_type ()

AdwFlapTransitionType
adw_flap_get_transition_type (AdwFlap *self);

Gets the type of animation that will be used for reveal and fold transitions in self .

Parameters

self

a AdwFlap

 

Returns

the current transition type of self

Since: 1.0


adw_flap_set_transition_type ()

void
adw_flap_set_transition_type (AdwFlap *self,
                              AdwFlapTransitionType transition_type);

Sets the type of animation that will be used for reveal and fold transitions in self .

“flap” is transparent by default, which means the content will be seen through it with ADW_FLAP_TRANSITION_TYPE_OVER transitions; add the .background style class to it if this is unwanted.

Parameters

self

a AdwFlap

 

transition_type

the new transition type

 

Since: 1.0


adw_flap_get_modal ()

gboolean
adw_flap_get_modal (AdwFlap *self);

Gets whether the self is modal. See adw_flap_set_modal().

Parameters

self

a AdwFlap

 

Returns

TRUE if self is modal

Since: 1.0


adw_flap_set_modal ()

void
adw_flap_set_modal (AdwFlap *self,
                    gboolean modal);

Sets whether the self can be closed with a click.

If modal is TRUE, clicking the content widget while flap is revealed, or pressing Escape key, will close the flap. If FALSE, clicks are passed through to the content widget.

Parameters

self

a AdwFlap

 

modal

Whether self can be closed with a click

 

Since: 1.0


adw_flap_get_swipe_to_open ()

gboolean
adw_flap_get_swipe_to_open (AdwFlap *self);

Gets whether self can be opened with a swipe gesture.

Parameters

self

a AdwFlap

 

Returns

TRUE if self can be opened with a swipe gesture

Since: 1.0


adw_flap_set_swipe_to_open ()

void
adw_flap_set_swipe_to_open (AdwFlap *self,
                            gboolean swipe_to_open);

Sets whether self can be opened with a swipe gesture.

The area that can be swiped depends on the “transition-type” value.

Parameters

self

a AdwFlap

 

swipe_to_open

Whether self can be opened with a swipe gesture

 

Since: 1.0


adw_flap_get_swipe_to_close ()

gboolean
adw_flap_get_swipe_to_close (AdwFlap *self);

Gets whether self can be closed with a swipe gesture.

Parameters

self

a AdwFlap

 

Returns

TRUE if self can be closed with a swipe gesture

Since: 1.0


adw_flap_set_swipe_to_close ()

void
adw_flap_set_swipe_to_close (AdwFlap *self,
                             gboolean swipe_to_close);

Sets whether self can be closed with a swipe gesture.

The area that can be swiped depends on the “transition-type” value.

Parameters

self

a AdwFlap

 

swipe_to_close

Whether self can be closed with a swipe gesture

 

Since: 1.0

Types and Values

ADW_TYPE_FLAP

#define ADW_TYPE_FLAP (adw_flap_get_type ())

enum AdwFlapFoldPolicy

These enumeration values describe the possible folding behavior in a AdwFlap widget.

Members

ADW_FLAP_FOLD_POLICY_NEVER

Disable folding, the flap cannot reach narrow sizes.

 

ADW_FLAP_FOLD_POLICY_ALWAYS

Keep the flap always folded.

 

ADW_FLAP_FOLD_POLICY_AUTO

Fold and unfold the flap based on available space.

 

Since: 1.0


enum AdwFlapTransitionType

These enumeration values describe the possible transitions between children in a AdwFlap widget, as well as which areas can be swiped via “swipe-to-open” and “swipe-to-close”.

New values may be added to this enum over time.

Members

ADW_FLAP_TRANSITION_TYPE_OVER

The flap slides over the content, which is dimmed. When folded, only the flap can be swiped.

 

ADW_FLAP_TRANSITION_TYPE_UNDER

The content slides over the flap. Only the content can be swiped.

 

ADW_FLAP_TRANSITION_TYPE_SLIDE

The flap slides offscreen when hidden, neither the flap nor content overlap each other. Both widgets can be swiped.

 

Since: 1.0


AdwFlap

typedef struct _AdwFlap AdwFlap;

Property Details

The “content” property

  “content”                  GtkWidget *

The content widget, always displayed when unfolded, and partially visible when folded.

Owner: AdwFlap

Flags: Read / Write

Since: 1.0


The “flap” property

  “flap”                     GtkWidget *

The flap widget, only visible when “reveal-progress” is greater than 0.

Owner: AdwFlap

Flags: Read / Write

Since: 1.0


The “flap-position” property

  “flap-position”            GtkPackType

The flap position for self . If GTK_PACK_START , the flap is displayed before the content, if GTK_PACK_END , it's displayed after the content.

Owner: AdwFlap

Flags: Read / Write

Default value: GTK_PACK_START

Since: 1.0


The “fold-duration” property

  “fold-duration”            guint

The fold transition animation duration, in milliseconds.

Owner: AdwFlap

Flags: Read / Write

Allowed values: <= G_MAXINT

Default value: 250

Since: 1.0


The “fold-policy” property

  “fold-policy”              AdwFlapFoldPolicy

The current fold policy. See AdwFlapFoldPolicy for available policies.

Owner: AdwFlap

Flags: Read / Write

Default value: ADW_FLAP_FOLD_POLICY_AUTO

Since: 1.0


The “folded” property

  “folded”                   gboolean

Whether the flap is currently folded.

See “fold-policy”.

Owner: AdwFlap

Flags: Read

Default value: FALSE

Since: 1.0


The “locked” property

  “locked”                   gboolean

Whether the flap is locked.

If FALSE, folding when the flap is revealed automatically closes it, and unfolding it when the flap is not revealed opens it. If TRUE, “reveal-flap” value never changes on its own.

Owner: AdwFlap

Flags: Read / Write

Default value: FALSE

Since: 1.0


The “modal” property

  “modal”                    gboolean

Whether the flap is modal.

If TRUE, clicking the content widget while flap is revealed, as well as pressing Escape key, will close the flap. If FALSE, clicks are passed through to the content widget.

Owner: AdwFlap

Flags: Read / Write

Default value: TRUE

Since: 1.0


The “reveal-duration” property

  “reveal-duration”          guint

The reveal transition animation duration, in milliseconds.

Owner: AdwFlap

Flags: Read / Write

Allowed values: <= G_MAXINT

Default value: 250

Since: 1.0


The “reveal-flap” property

  “reveal-flap”              gboolean

Whether the flap widget is revealed.

Owner: AdwFlap

Flags: Read / Write

Default value: TRUE

Since: 1.0


The “reveal-progress” property

  “reveal-progress”          double

The current reveal transition progress. 0 means fully hidden, 1 means fully revealed See “reveal-flap”.

Owner: AdwFlap

Flags: Read

Allowed values: [0,1]

Default value: 1

Since: 1.0


The “separator” property

  “separator”                GtkWidget *

The separator widget, displayed between content and flap when there's no shadow to display. When exactly it's visible depends on the “transition-type” value. If NULL, no separator will be used.

Owner: AdwFlap

Flags: Read / Write

Since: 1.0


The “swipe-to-close” property

  “swipe-to-close”           gboolean

Whether the flap can be closed with a swipe gesture.

The area that can be swiped depends on the “transition-type” value.

Owner: AdwFlap

Flags: Read / Write

Default value: TRUE

Since: 1.0


The “swipe-to-open” property

  “swipe-to-open”            gboolean

Whether the flap can be opened with a swipe gesture.

The area that can be swiped depends on the “transition-type” value.

Owner: AdwFlap

Flags: Read / Write

Default value: TRUE

Since: 1.0


The “transition-type” property

  “transition-type”          AdwFlapTransitionType

The type of animation that will be used for reveal and fold transitions in self .

“flap” is transparent by default, which means the content will be seen through it with ADW_FLAP_TRANSITION_TYPE_OVER transitions; add the .background style class to it if this is unwanted.

Owner: AdwFlap

Flags: Read / Write

Default value: ADW_FLAP_TRANSITION_TYPE_OVER

Since: 1.0