Handy.Deck¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2), Handy.Swipeable (8)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
Whether or not swipe gesture can be used to switch to the previous child |
||
r/w/en |
Whether or not swipe gesture can be used to switch to the next child |
||
r/w/en |
Horizontally homogeneous sizing |
||
r/w/en |
Whether or not the size should smoothly change when changing between differently sized children |
||
r/w/en |
The transition animation duration, in milliseconds |
||
r |
Whether or not the transition is currently running |
||
r/w/en |
The type of animation used to transition between children |
||
r/w/en |
Vertically homogeneous sizing |
||
r/w/en |
The widget currently visible |
||
r/w/en |
The name of the widget currently visible |
Child Properties¶
Name |
Type |
Default |
Flags |
Short Description |
---|---|---|---|---|
|
r/w |
The name of the child page |
Style Properties¶
- Inherited:
Signals¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Handy.Deck(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A swipeable widget showing one of the visible children at a time.
The
HdyDeck
widget displays one of the visible children, similar to a [class`Gtk`.Stack]. The children are strictly ordered and can be navigated using swipe gestures.The “over” and “under” stack the children one on top of the other, while the “slide” transition puts the children side by side. While navigating to a child on the side or below can be performed by swiping the current child away, navigating to an upper child requires dragging it from the edge where it resides. This doesn’t affect non-dragging swipes.
The “over” and “under” transitions can draw their shadow on top of the window’s transparent areas, like the rounded corners. This is a side-effect of allowing shadows to be drawn on top of OpenGL areas. It can be mitigated by using [class`Window`] or [class`ApplicationWindow`] as they will crop anything drawn beyond the rounded corners.
- CSS nodes
HdyDeck
has a single CSS node with namedeck
.New in version 1.0.
- classmethod new()¶
- Returns:
the newly created
HdyDeck
- Return type:
Creates a new
HdyDeck
.New in version 1.0.
- get_adjacent_child(direction)¶
- Parameters:
direction (
Handy.NavigationDirection
) – the direction- Returns:
the previous or next child
- Return type:
Gtk.Widget
orNone
Finds the previous or next navigatable child.
Gets the previous or next child. This will be the same widget [method`Deck`.navigate] will navigate to.
If there’s no child to navigate to,
NULL
will be returned instead.New in version 1.0.
- get_can_swipe_back()¶
- Returns:
Whether swipe gestures are enabled.
- Return type:
Gets whether swipe gestures for navigating backward are enabled.
New in version 1.0.
- get_can_swipe_forward()¶
- Returns:
Whether swipe gestures are enabled.
- Return type:
Gets whether swipe gestures for navigating forward enabled.
New in version 1.0.
- get_child_by_name(name)¶
- Parameters:
name (
str
) – the name of the child to find- Returns:
the requested child of self
- Return type:
Gtk.Widget
orNone
Finds the child of self with name.
Returns
NULL
if there is no child with this name.New in version 1.0.
- get_homogeneous(orientation)¶
- Parameters:
orientation (
Gtk.Orientation
) – the orientation- Returns:
whether self is homogeneous for the given orientation
- Return type:
Gets whether self is homogeneous for the given orientation.
New in version 1.0.
- get_interpolate_size()¶
- Returns:
whether child sizes are interpolated
- Return type:
Gets whether self will interpolate its size when changing the visible child.
New in version 1.0.
- get_transition_duration()¶
- Returns:
the mode transition duration, in milliseconds.
- Return type:
Gets the mode transition animation duration for self.
New in version 1.0.
- get_transition_running()¶
- Returns:
whether a transition is currently running
- Return type:
Gets whether a transition is currently running for self.
New in version 1.0.
- get_transition_type()¶
- Returns:
the current transition type of self
- Return type:
Gets the type of animation used for transitions between children.
New in version 1.0.
- get_visible_child()¶
- Returns:
the visible child widget
- Return type:
Gets the visible child widget.
New in version 1.0.
- get_visible_child_name()¶
- Returns:
the name of the visible child
- Return type:
Gets the name of the currently visible child widget.
New in version 1.0.
- insert_child_after(child, sibling)¶
- Parameters:
child (
Gtk.Widget
) – the widget to insertsibling (
Gtk.Widget
orNone
) – the sibling after which to insert child
Inserts child in the position after sibling in the list of children.
If sibling is
NULL
, inserts child at the first position.New in version 1.2.
- Parameters:
direction (
Handy.NavigationDirection
) – the direction- Returns:
whether the visible child was changed
- Return type:
Navigates to the previous or next child.
The switch is similar to performing a swipe gesture to go in direction.
New in version 1.0.
- prepend(child)¶
- Parameters:
child (
Gtk.Widget
) – the widget to prepend
Inserts child at the first position in self.
New in version 1.2.
- reorder_child_after(child, sibling)¶
- Parameters:
child (
Gtk.Widget
) – the widget to move, must be a child of selfsibling (
Gtk.Widget
orNone
) – the sibling to move child after
Moves child to the position after sibling in the list of children.
If sibling is
NULL
, move child to the first position.New in version 1.2.
- set_can_swipe_back(can_swipe_back)¶
- Parameters:
can_swipe_back (
bool
) – the new value
Sets whether swipe gestures for navigating backward are enabled.
New in version 1.0.
- set_can_swipe_forward(can_swipe_forward)¶
- Parameters:
can_swipe_forward (
bool
) – the new value
Sets whether swipe gestures for navigating forward are enabled.
New in version 1.0.
- set_homogeneous(orientation, homogeneous)¶
- Parameters:
orientation (
Gtk.Orientation
) – the orientationhomogeneous (
bool
) –TRUE
to make self homogeneous
Sets whether self is homogeneous for a given orientation.
If set to
FALSE
, different children can have different size along the opposite orientation.New in version 1.0.
- set_interpolate_size(interpolate_size)¶
- Parameters:
interpolate_size (
bool
) – the new value
Sets whether self will interpolate its size when changing the visible child.
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.
New in version 1.0.
- set_transition_duration(duration)¶
- Parameters:
duration (
int
) – the new duration, in milliseconds
Sets the mode transition animation duration for self.
New in version 1.0.
- set_transition_type(transition)¶
- Parameters:
transition (
Handy.DeckTransitionType
) – the new transition type
Sets the type of animation 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.
New in version 1.0.
- set_visible_child(visible_child)¶
- Parameters:
visible_child (
Gtk.Widget
) – the new child
Sets the currently visible widget.
New in version 1.0.
Property Details¶
- Handy.Deck.props.can_swipe_back¶
- Name:
can-swipe-back
- Type:
- Default Value:
- Flags:
Whether swipe gestures allow switching to the previous child.
New in version 1.0.
- Handy.Deck.props.can_swipe_forward¶
- Name:
can-swipe-forward
- Type:
- Default Value:
- Flags:
Whether swipe gestures allow switching to the next child.
New in version 1.0.
- Handy.Deck.props.hhomogeneous¶
- Name:
hhomogeneous
- Type:
- Default Value:
- Flags:
Horizontally homogeneous sizing.
New in version 1.0.
- Handy.Deck.props.interpolate_size¶
- Name:
interpolate-size
- Type:
- Default Value:
- Flags:
Whether or not the size should smoothly change when changing between differently sized children.
New in version 1.0.
- Handy.Deck.props.transition_duration¶
- Name:
transition-duration
- Type:
- Default Value:
200
- Flags:
The transition animation duration, in milliseconds.
New in version 1.0.
- Handy.Deck.props.transition_running¶
-
Whether or not the transition is currently running.
New in version 1.0.
- Handy.Deck.props.transition_type¶
- Name:
transition-type
- Type:
- Default Value:
- Flags:
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.
New in version 1.0.
- Handy.Deck.props.vhomogeneous¶
- Name:
vhomogeneous
- Type:
- Default Value:
- Flags:
Vertically homogeneous sizing.
New in version 1.0.
- Handy.Deck.props.visible_child¶
- Name:
visible-child
- Type:
- Default Value:
- Flags:
The widget currently visible.
The transition is determined by [property`Deck`:py:data::transition-type<Handy.Deck.props.transition_type>] and [property`Deck`:py:data::transition-duration<Handy.Deck.props.transition_duration>]. The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.
New in version 1.0.