Top |
gboolean | can-swipe-back | Read / Write |
gboolean | can-swipe-forward | 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 |
HdyLeafletTransitionType | 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 |
#define | HDY_TYPE_LEAFLET |
enum | HdyLeafletTransitionType |
struct | HdyLeafletClass |
HdyLeaflet |
GEnum ╰── HdyLeafletTransitionType GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── HdyLeaflet
HdyLeaflet implements AtkImplementorIface, GtkBuildable, GtkOrientable and HdySwipeable.
The HdyLeaflet widget can display its children like a GtkBox does or like a GtkStack 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.
HdyLeaflet has a single CSS node with name leaflet. The node will get the style classes .folded when it is folded, .unfolded when it's not, or none if it didn't compute its fold yet.
gboolean
hdy_leaflet_get_folded (HdyLeaflet *self
);
Gets whether self
is folded.
GtkWidget *
hdy_leaflet_get_visible_child (HdyLeaflet *self
);
Gets the visible child widget.
void hdy_leaflet_set_visible_child (HdyLeaflet *self
,GtkWidget *visible_child
);
Makes visible_child
visible using a transition determined by
HdyLeaflet:transition-type and HdyLeaflet:child-transition-duration. The
transition can be cancelled by the user, in which case visible child will
change back to the previously visible child.
const gchar *
hdy_leaflet_get_visible_child_name (HdyLeaflet *self
);
Gets the name of the currently visible child widget.
void hdy_leaflet_set_visible_child_name (HdyLeaflet *self
,const gchar *name
);
Makes the child with the name name
visible.
See hdy_leaflet_set_visible_child()
for more details.
gboolean hdy_leaflet_get_homogeneous (HdyLeaflet *self
,gboolean folded
,GtkOrientation orientation
);
Gets whether self
is homogeneous for the given fold and orientation.
See hdy_leaflet_set_homogeneous()
.
void hdy_leaflet_set_homogeneous (HdyLeaflet *self
,gboolean folded
,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.
self |
||
folded |
the fold |
|
orientation |
the orientation |
|
homogeneous |
|
HdyLeafletTransitionType
hdy_leaflet_get_transition_type (HdyLeaflet *self
);
Gets the type of animation that will be used
for transitions between modes and children in self
.
Since: 0.0.12
void hdy_leaflet_set_transition_type (HdyLeaflet *self
,HdyLeafletTransitionType 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: 0.0.12
guint
hdy_leaflet_get_mode_transition_duration
(HdyLeaflet *self
);
Returns the amount of time (in milliseconds) that
transitions between modes in self
will take.
void hdy_leaflet_set_mode_transition_duration (HdyLeaflet *self
,guint duration
);
Sets the duration that transitions between modes in self
will take.
guint
hdy_leaflet_get_child_transition_duration
(HdyLeaflet *self
);
Returns the amount of time (in milliseconds) that
transitions between children in self
will take.
void hdy_leaflet_set_child_transition_duration (HdyLeaflet *self
,guint duration
);
Sets the duration that transitions between children in self
will take.
gboolean
hdy_leaflet_get_child_transition_running
(HdyLeaflet *self
);
Returns whether self
is currently in a transition from one page to
another.
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.
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
, 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.
gboolean
hdy_leaflet_get_can_swipe_back (HdyLeaflet *self
);
Returns whether the HdyLeaflet allows swiping to the previous child.
Since: 0.0.12
void hdy_leaflet_set_can_swipe_back (HdyLeaflet *self
,gboolean can_swipe_back
);
Sets whether or not self
allows switching to the previous child that has
'allow-visible' child property set to TRUE
via a swipe gesture
Since: 0.0.12
gboolean
hdy_leaflet_get_can_swipe_forward (HdyLeaflet *self
);
Returns whether the HdyLeaflet allows swiping to the next child.
Since: 0.0.12
void hdy_leaflet_set_can_swipe_forward (HdyLeaflet *self
,gboolean can_swipe_forward
);
Sets whether or not self
allows switching to the next child that has
'allow-visible' child property set to TRUE
via a swipe gesture.
Since: 0.0.12
gboolean hdy_leaflet_navigate (HdyLeaflet *self
,HdyNavigationDirection direction
);
Switches to the previous or next child that doesn't have 'allow-visible'
child property set to FALSE
, similar to performing a swipe gesture to go
in direction
.
Since: 1.0
This enumeration value describes the possible transitions between modes and children in a HdyLeaflet widget.
New values may be added to this enumeration over time.
No transition |
||
Slide from left, right, up or down according to the orientation, text direction and the children order |
||
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 |
Since: 0.0.12
“can-swipe-back”
property“can-swipe-back” gboolean
Whether or not self
allows switching to the previous child that has
'allow-visible' child property set to TRUE
via a swipe gesture.
Owner: HdyLeaflet
Flags: Read / Write
Default value: FALSE
Since: 0.0.12
“can-swipe-forward”
property“can-swipe-forward” gboolean
Whether or not self
allows switching to the next child that has
'allow-visible' child property set to TRUE
via a swipe gesture.
Owner: HdyLeaflet
Flags: Read / Write
Default value: FALSE
Since: 0.0.12
“child-transition-duration”
property“child-transition-duration” guint
The child transition animation duration, in milliseconds.
Owner: HdyLeaflet
Flags: Read / Write
Default value: 200
“child-transition-running”
property“child-transition-running” gboolean
Whether or not the child transition is currently running.
Owner: HdyLeaflet
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: HdyLeaflet
Flags: Read
Default value: FALSE
“hhomogeneous-folded”
property“hhomogeneous-folded” gboolean
Horizontally homogeneous sizing when the leaflet is folded.
Owner: HdyLeaflet
Flags: Read / Write
Default value: TRUE
“hhomogeneous-unfolded”
property“hhomogeneous-unfolded” gboolean
Horizontally homogeneous sizing when the leaflet is unfolded.
Owner: HdyLeaflet
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: HdyLeaflet
Flags: Read / Write
Default value: FALSE
“mode-transition-duration”
property“mode-transition-duration” guint
The mode transition animation duration, in milliseconds.
Owner: HdyLeaflet
Flags: Read / Write
Default value: 250
“transition-type”
property“transition-type” HdyLeafletTransitionType
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: HdyLeaflet
Flags: Read / Write
Default value: HDY_LEAFLET_TRANSITION_TYPE_OVER
Since: 0.0.12
“vhomogeneous-folded”
property“vhomogeneous-folded” gboolean
Vertically homogeneous sizing when the leaflet is folded.
Owner: HdyLeaflet
Flags: Read / Write
Default value: TRUE
“vhomogeneous-unfolded”
property“vhomogeneous-unfolded” gboolean
Vertically homogeneous sizing when the leaflet is unfolded.
Owner: HdyLeaflet
Flags: Read / Write
Default value: FALSE
“visible-child”
property“visible-child” GtkWidget *
The widget currently visible when the leaflet is folded.
Owner: HdyLeaflet
Flags: Read / Write
“visible-child-name”
property“visible-child-name” gchar *
The name of the widget currently visible when the children are stacked.
Owner: HdyLeaflet
Flags: Read / Write
Default value: NULL