Top | ![]() |
![]() |
![]() |
![]() |
gboolean | can-swipe-back | Read / Write |
gboolean | can-swipe-forward | Read / Write |
gboolean | can-unfold | Read / Write |
guint | child-transition-duration | Read / Write |
gboolean | child-transition-running | 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 |
GtkSelectionModel * | pages | Read |
AdwLeafletTransitionType | transition-type | Read / Write |
gboolean | vhomogeneous-folded | Read / Write |
gboolean | vhomogeneous-unfolded | Read / Write |
GtkWidget * | visible-child | Read / Write |
char * | visible-child-name | Read / Write |
GtkWidget * | child | Read / Write / Construct Only |
char * | name | Read / Write |
gboolean | navigatable | Read / Write |
#define | ADW_TYPE_LEAFLET_PAGE |
#define | ADW_TYPE_LEAFLET |
enum | AdwLeafletTransitionType |
AdwLeaflet | |
AdwLeafletPage |
AdwLeaflet implements GtkAccessible, GtkBuildable, GtkConstraintTarget, GtkOrientable and AdwSwipeable.
GtkWidget *
adw_leaflet_page_get_child (AdwLeafletPage *self
);
Returns the leaflet child to which self
belongs.
Since: 1.0
const char *
adw_leaflet_page_get_name (AdwLeafletPage *self
);
Returns the current value of the “name” property.
The value of the “name” property.
See adw_leaflet_page_set_name()
for details on how to set a new value.
[nullable]
Since: 1.0
void adw_leaflet_page_set_name (AdwLeafletPage *self
,const char *name
);
Sets the new value of the “name” property.
See also adw_leaflet_page_get_name()
Since: 1.0
gboolean
adw_leaflet_page_get_navigatable (AdwLeafletPage *self
);
Gets whether the child can be navigated to when folded.
See adw_leaflet_page_set_navigatable()
and “navigatable”.
Since: 1.0
void adw_leaflet_page_set_navigatable (AdwLeafletPage *self
,gboolean navigatable
);
Sets whether the child can be navigated to when folded.
If FALSE
, the child will be ignored by adw_leaflet_get_adjacent_child()
,
adw_leaflet_navigate()
, and swipe gestures.
This can be used used to prevent switching to widgets like separators.
Sets the new value of the “navigatable” property to
navigatable
.
Since: 1.0
AdwLeafletPage * adw_leaflet_append (AdwLeaflet *self
,GtkWidget *child
);
Adds a child to self
.
Since: 1.0
AdwLeafletPage * adw_leaflet_prepend (AdwLeaflet *self
,GtkWidget *child
);
Inserts child
at the first position in self
.
Since: 1.0
AdwLeafletPage * adw_leaflet_insert_child_after (AdwLeaflet *self
,GtkWidget *child
,GtkWidget *sibling
);
Inserts child
in the position after sibling
in the list of children.
If sibling
is NULL
, insert child
at the first position.
self |
||
child |
the GtkWidget to insert |
|
sibling |
the sibling after which to insert |
[nullable] |
Since: 1.0
void adw_leaflet_reorder_child_after (AdwLeaflet *self
,GtkWidget *child
,GtkWidget *sibling
);
Moves child
to the position after sibling
in the list of children.
If sibling
is NULL
, move child
to the first position.
self |
||
child |
the GtkWidget to move, must be a child of |
|
sibling |
the sibling to move |
[nullable] |
Since: 1.0
void adw_leaflet_remove (AdwLeaflet *self
,GtkWidget *child
);
Removes a child widget from self
.
Since: 1.0
AdwLeafletPage * adw_leaflet_get_page (AdwLeaflet *self
,GtkWidget *child
);
Returns the AdwLeafletPage object for child
.
Since: 1.0
gboolean
adw_leaflet_get_folded (AdwLeaflet *self
);
Gets whether self
is folded.
Since: 1.0
GtkWidget *
adw_leaflet_get_visible_child (AdwLeaflet *self
);
Gets the visible child widget.
Since: 1.0
void adw_leaflet_set_visible_child (AdwLeaflet *self
,GtkWidget *visible_child
);
Makes visible_child
visible using a transition determined by
AdwLeaflet:transition-type and AdwLeaflet:child-transition-duration. The
transition can be cancelled by the user, in which case visible child will
change back to the previously visible child.
Since: 1.0
const char *
adw_leaflet_get_visible_child_name (AdwLeaflet *self
);
Gets the name of the currently visible child widget.
Since: 1.0
void adw_leaflet_set_visible_child_name (AdwLeaflet *self
,const char *name
);
Makes the child with the name name
visible.
See adw_leaflet_set_visible_child()
for more details.
Since: 1.0
gboolean adw_leaflet_get_homogeneous (AdwLeaflet *self
,gboolean folded
,GtkOrientation orientation
);
Gets whether self
is homogeneous for the given fold and orientation.
See adw_leaflet_set_homogeneous()
.
Since: 1.0
void adw_leaflet_set_homogeneous (AdwLeaflet *self
,gboolean folded
,GtkOrientation orientation
,gboolean homogeneous
);
Sets the AdwLeaflet to be homogeneous or not for the given fold and orientation. If it is homogeneous, the AdwLeaflet 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.
self |
||
folded |
the fold |
|
orientation |
the orientation |
|
homogeneous |
|
Since: 1.0
AdwLeafletTransitionType
adw_leaflet_get_transition_type (AdwLeaflet *self
);
Gets the type of animation that will be used
for transitions between modes and children in self
.
Since: 1.0
void adw_leaflet_set_transition_type (AdwLeaflet *self
,AdwLeafletTransitionType transition
);
Sets the type of animation that will be used for transitions between modes
and 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 or child that is about to become current.
Since: 1.0
guint
adw_leaflet_get_mode_transition_duration
(AdwLeaflet *self
);
Returns the amount of time (in milliseconds) that
transitions between modes in self
will take.
Since: 1.0
void adw_leaflet_set_mode_transition_duration (AdwLeaflet *self
,guint duration
);
Sets the duration that transitions between modes in self
will take.
Since: 1.0
guint
adw_leaflet_get_child_transition_duration
(AdwLeaflet *self
);
Returns the amount of time (in milliseconds) that
transitions between children in self
will take.
Since: 1.0
void adw_leaflet_set_child_transition_duration (AdwLeaflet *self
,guint duration
);
Sets the duration that transitions between children in self
will take.
Since: 1.0
gboolean
adw_leaflet_get_child_transition_running
(AdwLeaflet *self
);
Returns whether self
is currently in a transition from one page to
another.
Since: 1.0
gboolean
adw_leaflet_get_interpolate_size (AdwLeaflet *self
);
Returns whether the AdwLeaflet is set up to interpolate between the sizes of children on page switch.
Since: 1.0
void adw_leaflet_set_interpolate_size (AdwLeaflet *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.
Since: 1.0
gboolean
adw_leaflet_get_can_swipe_back (AdwLeaflet *self
);
Returns whether the AdwLeaflet allows swiping to the previous child.
Since: 1.0
void adw_leaflet_set_can_swipe_back (AdwLeaflet *self
,gboolean can_swipe_back
);
Sets whether or not self
allows switching to the previous child that has
'navigatable' child property set to TRUE
via a swipe gesture
Since: 1.0
gboolean
adw_leaflet_get_can_swipe_forward (AdwLeaflet *self
);
Returns whether the AdwLeaflet allows swiping to the next child.
Since: 1.0
void adw_leaflet_set_can_swipe_forward (AdwLeaflet *self
,gboolean can_swipe_forward
);
Sets whether or not self
allows switching to the next child that has
'navigatable' child property set to TRUE
via a swipe gesture.
Since: 1.0
GtkWidget * adw_leaflet_get_adjacent_child (AdwLeaflet *self
,AdwNavigationDirection direction
);
Gets the previous or next child that doesn't have 'navigatable' child
property set to FALSE
, or NULL
if it doesn't exist. This will be the same
widget adw_leaflet_navigate()
will navigate to.
Since: 1.0
gboolean adw_leaflet_navigate (AdwLeaflet *self
,AdwNavigationDirection direction
);
Switches to the previous or next child that doesn't have 'navigatable' child
property set to FALSE
, similar to performing a swipe gesture to go in
direction
.
Since: 1.0
GtkWidget * adw_leaflet_get_child_by_name (AdwLeaflet *self
,const char *name
);
Finds the child of self
with the name given as the argument. Returns NULL
if there is no child with this name.
Since: 1.0
void adw_leaflet_set_can_unfold (AdwLeaflet *self
,gboolean can_unfold
);
GtkSelectionModel *
adw_leaflet_get_pages (AdwLeaflet *self
);
Returns a GListModel that contains the pages of the leaflet, 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.
Since: 1.0
This enumeration value describes the possible transitions between modes and children in a AdwLeaflet widget.
New values may be added to this enumeration over time.
Cover the old page or uncover the new page, sliding from or towards the end according to orientation, text direction and children order |
||
Uncover the new page or cover the old page, sliding from or towards the start according to orientation, text direction and children order |
||
Slide from left, right, up or down according to the orientation, text direction and the children order |
Since: 1.0
“can-swipe-back”
property “can-swipe-back” gboolean
Whether or not the leaflet allows switching to the previous child that has
'navigatable' child property set to TRUE
via a swipe gesture.
Owner: AdwLeaflet
Flags: Read / Write
Default value: FALSE
Since: 1.0
“can-swipe-forward”
property “can-swipe-forward” gboolean
Whether or not the leaflet allows switching to the next child that has
'navigatable' child property set to TRUE
via a swipe gesture.
Owner: AdwLeaflet
Flags: Read / Write
Default value: FALSE
Since: 1.0
“can-unfold”
property “can-unfold” gboolean
Whether or not the leaflet can unfold.
Owner: AdwLeaflet
Flags: Read / Write
Default value: TRUE
“child-transition-duration”
property “child-transition-duration” guint
The child transition animation duration, in milliseconds.
Owner: AdwLeaflet
Flags: Read / Write
Default value: 200
“child-transition-running”
property “child-transition-running” gboolean
Whether or not the child transition is currently running.
Owner: AdwLeaflet
Flags: Read
Default value: FALSE
“folded”
property “folded” gboolean
TRUE
if the leaflet is folded.
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.
Owner: AdwLeaflet
Flags: Read
Default value: FALSE
Since: 1.0
“hhomogeneous-folded”
property “hhomogeneous-folded” gboolean
Horizontally homogeneous sizing when the leaflet is folded.
Owner: AdwLeaflet
Flags: Read / Write
Default value: TRUE
“hhomogeneous-unfolded”
property “hhomogeneous-unfolded” gboolean
Horizontally homogeneous sizing when the leaflet is unfolded.
Owner: AdwLeaflet
Flags: Read / Write
Default value: FALSE
“interpolate-size”
property “interpolate-size” gboolean
Whether or not the size should smoothly change when changing between differently sized children.
Owner: AdwLeaflet
Flags: Read / Write
Default value: FALSE
“mode-transition-duration”
property “mode-transition-duration” guint
The mode transition animation duration, in milliseconds.
Owner: AdwLeaflet
Flags: Read / Write
Default value: 250
“pages”
property “pages” GtkSelectionModel *
A selection model with the leaflet's pages.
Owner: AdwLeaflet
Flags: Read
“transition-type”
property“transition-type” AdwLeafletTransitionType
The type of animation that will be used for transitions between modes and children.
The transition type can be changed without problems at runtime, so it is possible to change the animation based on the mode or child that is about to become current.
Owner: AdwLeaflet
Flags: Read / Write
Default value: ADW_LEAFLET_TRANSITION_TYPE_OVER
Since: 1.0
“vhomogeneous-folded”
property “vhomogeneous-folded” gboolean
Vertically homogeneous sizing when the leaflet is folded.
Owner: AdwLeaflet
Flags: Read / Write
Default value: TRUE
“vhomogeneous-unfolded”
property “vhomogeneous-unfolded” gboolean
Vertically homogeneous sizing when the leaflet is unfolded.
Owner: AdwLeaflet
Flags: Read / Write
Default value: FALSE
“visible-child”
property “visible-child” GtkWidget *
The widget currently visible when the leaflet is folded.
Owner: AdwLeaflet
Flags: Read / Write
“visible-child-name”
property “visible-child-name” char *
The name of the widget currently visible when the children are stacked.
Owner: AdwLeaflet
Flags: Read / Write
Default value: NULL
“child”
property “child” GtkWidget *
The child of the page.
Owner: AdwLeafletPage
Flags: Read / Write / Construct Only
“name”
property “name” char *
The name of the child page.
Owner: AdwLeafletPage
Flags: Read / Write
Default value: NULL
“navigatable”
property “navigatable” gboolean
Whether the child can be navigated to when folded.
If FALSE
, the child will be ignored by adw_leaflet_get_adjacent_child()
,
adw_leaflet_navigate()
, and swipe gestures.
This can be used used to prevent switching to widgets like separators.
Owner: AdwLeafletPage
Flags: Read / Write
Default value: TRUE
Since: 1.0