adw-squeezer

adw-squeezer

Functions

Properties

gboolean homogeneous Read / Write
gboolean interpolate-size Read / Write
GtkSelectionModel * pages Read
guint transition-duration Read / Write
gboolean transition-running Read
AdwSqueezerTransitionType transition-type Read / Write
GtkWidget * visible-child Read
float xalign Read / Write
float yalign Read / Write
GtkWidget * child Read / Write / Construct Only
gboolean enabled Read / Write

Types and Values

Object Hierarchy

    GObject
    ├── AdwSqueezerPage
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── AdwSqueezer

Implemented Interfaces

AdwSqueezer implements GtkAccessible, GtkBuildable, GtkConstraintTarget and GtkOrientable.

Description

Functions

adw_squeezer_page_get_child ()

GtkWidget *
adw_squeezer_page_get_child (AdwSqueezerPage *self);

Returns the squeezer child to which self belongs.

Parameters

self

a AdwSqueezerPage

 

Returns

the child to which self belongs.

[transfer none]

Since: 1.0


adw_squeezer_page_get_enabled ()

gboolean
adw_squeezer_page_get_enabled (AdwSqueezerPage *self);

Returns whether self is enabled in its AdwSqueezer. This is independent from the “visible” value of its GtkWidget.

See adw_squeezer_page_set_enabled().

Parameters

self

a AdwSqueezerPage

 

Returns

TRUE if self is enabled, FALSE otherwise

Since: 1.0


adw_squeezer_page_set_enabled ()

void
adw_squeezer_page_set_enabled (AdwSqueezerPage *self,
                               gboolean enabled);

Make the squeezer enable or disable child . If a child is disabled, it will be ignored when looking for the child fitting the available size best. This allows to programmatically and prematurely hide a child even if it fits in the available space.

This can be used e.g. to ensure a certain child is hidden below a certain window width, or any other constraint you find suitable.

Sets the new value of the “enabled” property to enabled .

Parameters

self

a AdwSqueezerPage

 

enabled

TRUE to enable the child, FALSE to disable it

 

Since: 1.0


adw_squeezer_new ()

GtkWidget *
adw_squeezer_new (void);

Creates a new AdwSqueezer container.

Returns

a new AdwSqueezer

Since: 1.0


adw_squeezer_add ()

AdwSqueezerPage *
adw_squeezer_add (AdwSqueezer *self,
                  GtkWidget *child);

Adds a child to self .

Parameters

self

a AdwSqueezer

 

child

the widget to add

 

Returns

the AdwSqueezerPage for child .

[transfer none]

Since: 1.0


adw_squeezer_remove ()

void
adw_squeezer_remove (AdwSqueezer *self,
                     GtkWidget *child);

Removes a child widget from self .

Parameters

self

a AdwSqueezer

 

child

the child to remove

 

Since: 1.0


adw_squeezer_get_page ()

AdwSqueezerPage *
adw_squeezer_get_page (AdwSqueezer *self,
                       GtkWidget *child);

Returns the AdwSqueezerPage object for child .

Parameters

self

a AdwSqueezer

 

child

a child of self

 

Returns

the AdwSqueezerPage for child .

[transfer none]

Since: 1.0


adw_squeezer_get_homogeneous ()

gboolean
adw_squeezer_get_homogeneous (AdwSqueezer *self);

Gets whether self is homogeneous.

See adw_squeezer_set_homogeneous().

Parameters

self

a AdwSqueezer

 

Returns

TRUE if self is homogeneous, FALSE is not

Since: 1.0


adw_squeezer_set_homogeneous ()

void
adw_squeezer_set_homogeneous (AdwSqueezer *self,
                              gboolean homogeneous);

Sets self to be homogeneous or not. If it is homogeneous, self will request the same size for all its children for its opposite orientation, e.g. if self is oriented horizontally and is homogeneous, it will request the same height for all its children. If it isn't, self may change size when a different child becomes visible.

Parameters

self

a AdwSqueezer

 

homogeneous

TRUE to make self homogeneous

 

Since: 1.0


adw_squeezer_get_transition_duration ()

guint
adw_squeezer_get_transition_duration (AdwSqueezer *self);

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

Parameters

self

a AdwSqueezer

 

Returns

the transition duration

Since: 1.0


adw_squeezer_set_transition_duration ()

void
adw_squeezer_set_transition_duration (AdwSqueezer *self,
                                      guint duration);

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

Parameters

self

a AdwSqueezer

 

duration

the new duration, in milliseconds

 

Since: 1.0


adw_squeezer_get_transition_type ()

AdwSqueezerTransitionType
adw_squeezer_get_transition_type (AdwSqueezer *self);

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

Parameters

self

a AdwSqueezer

 

Returns

the current transition type of self

Since: 1.0


adw_squeezer_set_transition_type ()

void
adw_squeezer_set_transition_type (AdwSqueezer *self,
                                  AdwSqueezerTransitionType transition);

Sets the type of animation that will be used for transitions between children in self . Available types include various kinds of fades and slides.

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 AdwSqueezer

 

transition

the new transition type

 

Since: 1.0


adw_squeezer_get_transition_running ()

gboolean
adw_squeezer_get_transition_running (AdwSqueezer *self);

Gets whether self is currently in a transition from one child to another.

Parameters

self

a AdwSqueezer

 

Returns

TRUE if the transition is currently running, FALSE otherwise.

Since: 1.0


adw_squeezer_get_interpolate_size ()

gboolean
adw_squeezer_get_interpolate_size (AdwSqueezer *self);

Gets whether self should interpolate its size on visible child change.

See adw_squeezer_set_interpolate_size().

Parameters

self

A AdwSqueezer

 

Returns

TRUE if self interpolates its size on visible child change, FALSE if not

Since: 1.0


adw_squeezer_set_interpolate_size ()

void
adw_squeezer_set_interpolate_size (AdwSqueezer *self,
                                   gboolean interpolate_size);

Sets whether or not self will interpolate the size of its opposing orientation when changing the visible child. If TRUE, self will interpolate its size between the one of the previous visible child and the one of the new visible child, according to the set transition duration and the orientation, e.g. if self is horizontal, it will interpolate the its height.

Parameters

self

A AdwSqueezer

 

interpolate_size

TRUE to interpolate the size

 

Since: 1.0


adw_squeezer_get_visible_child ()

GtkWidget *
adw_squeezer_get_visible_child (AdwSqueezer *self);

Gets the currently visible child of self , or NULL if there are no visible children.

Parameters

self

a AdwSqueezer

 

Returns

the visible child of the AdwSqueezer.

[transfer none][nullable]

Since: 1.0


adw_squeezer_get_xalign ()

float
adw_squeezer_get_xalign (AdwSqueezer *self);

Gets the “xalign” property for self .

Parameters

self

a AdwSqueezer

 

Returns

the xalign property

Since: 1.0


adw_squeezer_set_xalign ()

void
adw_squeezer_set_xalign (AdwSqueezer *self,
                         float xalign);

Sets the “xalign” property for self .

Parameters

self

a AdwSqueezer

 

xalign

the new xalign value, between 0 and 1

 

Since: 1.0


adw_squeezer_get_yalign ()

float
adw_squeezer_get_yalign (AdwSqueezer *self);

Gets the “yalign” property for self .

Parameters

self

a AdwSqueezer

 

Returns

the yalign property

Since: 1.0


adw_squeezer_set_yalign ()

void
adw_squeezer_set_yalign (AdwSqueezer *self,
                         float yalign);

Sets the “yalign” property for self .

Parameters

self

a AdwSqueezer

 

yalign

the new yalign value, between 0 and 1

 

Since: 1.0


adw_squeezer_get_pages ()

GtkSelectionModel *
adw_squeezer_get_pages (AdwSqueezer *self);

Returns a GListModel that contains the pages of the squeezer, and can be used to keep an up-to-date view. The model also implements GtkSelectionModel and can be used to track the visible page.

Parameters

self

a AdwSqueezer

 

Returns

a GtkSelectionModel for the squeezer's children.

[transfer full]

Since: 1.0

Types and Values

ADW_TYPE_SQUEEZER_PAGE

#define ADW_TYPE_SQUEEZER_PAGE (adw_squeezer_page_get_type ())

ADW_TYPE_SQUEEZER

#define ADW_TYPE_SQUEEZER (adw_squeezer_get_type ())

enum AdwSqueezerTransitionType

These enumeration values describe the possible transitions between children in a AdwSqueezer widget.

Members

ADW_SQUEEZER_TRANSITION_TYPE_NONE

No transition

 

ADW_SQUEEZER_TRANSITION_TYPE_CROSSFADE

A cross-fade

 

Since: 1.0


AdwSqueezer

typedef struct _AdwSqueezer AdwSqueezer;

AdwSqueezerPage

typedef struct _AdwSqueezerPage AdwSqueezerPage;

Property Details

The “homogeneous” property

  “homogeneous”              gboolean

Homogeneous sizing.

Owner: AdwSqueezer

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.

Owner: AdwSqueezer

Flags: Read / Write

Default value: FALSE


The “pages” property

  “pages”                    GtkSelectionModel *

A selection model with the squeezer's pages.

Owner: AdwSqueezer

Flags: Read


The “transition-duration” property

  “transition-duration”      guint

The animation duration, in milliseconds.

Owner: AdwSqueezer

Flags: Read / Write

Default value: 200


The “transition-running” property

  “transition-running”       gboolean

Whether or not the transition is currently running.

Owner: AdwSqueezer

Flags: Read

Default value: FALSE


The “transition-type” property

  “transition-type”          AdwSqueezerTransitionType

The type of animation used to transition.

Owner: AdwSqueezer

Flags: Read / Write

Default value: ADW_SQUEEZER_TRANSITION_TYPE_NONE


The “visible-child” property

  “visible-child”            GtkWidget *

The widget currently visible in the squeezer.

Owner: AdwSqueezer

Flags: Read


The “xalign” property

  “xalign”                   float

The xalign property determines the horizontal alignment of the children inside the squeezer's size allocation. Compare this to “halign”, which determines how the squeezer's size allocation is positioned in the space available for the squeezer. The range goes from 0 (start) to 1 (end).

This will affect the position of children too wide to fit in the squeezer as they are fading out.

Owner: AdwSqueezer

Flags: Read / Write

Allowed values: [0,1]

Default value: 0.5

Since: 1.0


The “yalign” property

  “yalign”                   float

The yalign property determines the vertical alignment of the children inside the squeezer's size allocation. Compare this to “valign”, which determines how the squeezer's size allocation is positioned in the space available for the squeezer. The range goes from 0 (top) to 1 (bottom).

This will affect the position of children too tall to fit in the squeezer as they are fading out.

Owner: AdwSqueezer

Flags: Read / Write

Allowed values: [0,1]

Default value: 0.5

Since: 1.0


The “child” property

  “child”                    GtkWidget *

The child of the page.

Owner: AdwSqueezerPage

Flags: Read / Write / Construct Only


The “enabled” property

  “enabled”                  gboolean

Whether the child can be picked or should be ignored when looking for the child fitting the available size best.

Owner: AdwSqueezerPage

Flags: Read / Write

Default value: TRUE