Handy.Swipeable¶
- Implementations:
Methods¶
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
Properties¶
None
Signals¶
Name |
Short Description |
---|---|
Emitted when the widget’s visible child is changed. |
Fields¶
None
Class Details¶
- class Handy.Swipeable¶
- Bases:
- Structure:
An interface for swipeable widgets.
The
HdySwipeable
interface is implemented by all swipeable widgets. They can be synced using [class`SwipeGroup`].See [class`SwipeTracker`] for details about implementing it.
New in version 1.0.
- emit_child_switched(index, duration)¶
- Parameters:
Emits [signal`Swipeable`:py:func:::child-switched<Handy.Swipeable.signals.child_switched>] signal.
This should be called when the widget switches visible child widget.
duration can be 0 if the child is switched without animation.
New in version 1.0.
- get_cancel_progress()¶
- Returns:
the cancel progress, unitless
- Return type:
Gets the progress self will snap back to after the gesture is canceled.
New in version 1.0.
- get_distance()¶
- Returns:
the swipe distance in pixels
- Return type:
Gets the swipe distance of self.
This corresponds to how many pixels 1 unit represents.
New in version 1.0.
- get_progress()¶
- Returns:
the current progress, unitless
- Return type:
Gets the current progress of self.
New in version 1.0.
- get_snap_points()¶
- Returns:
the snap points
- Return type:
[
float
]
Gets the snap points of self.
Each snap point represents a progress value that is considered acceptable to end the swipe on.
New in version 1.0.
- get_swipe_area(navigation_direction, is_drag)¶
- Parameters:
navigation_direction (
Handy.NavigationDirection
) – the direction of the swipeis_drag (
bool
) – whether the swipe is caused by a dragging gesture
- Returns:
a pointer to a rectangle to store the swipe area
- Return type:
rect:
Gdk.Rectangle
Gets the area self can start a swipe from for the given direction and gesture type.
This can be used to restrict swipes to only be possible from a certain area, for example, to only allow edge swipes, or to have a draggable element and ignore swipes elsewhere.
Swipe area is only considered for direct swipes (as in, not initiated by [class`SwipeGroup`]).
If not implemented, the default implementation returns the allocation of self, allowing swipes from anywhere.
New in version 1.0.
- get_swipe_tracker()¶
- Returns:
the swipe tracker
- Return type:
Gets the [class`SwipeTracker`] used by this swipeable widget.
New in version 1.0.
- switch_child(index, duration)¶
- Parameters:
Switches to child with index index.
See [signal`Swipeable`:py:func:::child-switched<Handy.Swipeable.signals.child_switched>].
New in version 1.0.
- do_get_cancel_progress() virtual¶
- Returns:
the cancel progress, unitless
- Return type:
Gets the progress self will snap back to after the gesture is canceled.
New in version 1.0.
- do_get_distance() virtual¶
- Returns:
the swipe distance in pixels
- Return type:
Gets the swipe distance of self.
This corresponds to how many pixels 1 unit represents.
New in version 1.0.
- do_get_progress() virtual¶
- Returns:
the current progress, unitless
- Return type:
Gets the current progress of self.
New in version 1.0.
- do_get_snap_points() virtual¶
- Returns:
the snap points
- Return type:
[
float
]
Gets the snap points of self.
Each snap point represents a progress value that is considered acceptable to end the swipe on.
New in version 1.0.
- do_get_swipe_area(navigation_direction, is_drag) virtual¶
- Parameters:
navigation_direction (
Handy.NavigationDirection
) – the direction of the swipeis_drag (
bool
) – whether the swipe is caused by a dragging gesture
- Returns:
a pointer to a rectangle to store the swipe area
- Return type:
rect:
Gdk.Rectangle
Gets the area self can start a swipe from for the given direction and gesture type.
This can be used to restrict swipes to only be possible from a certain area, for example, to only allow edge swipes, or to have a draggable element and ignore swipes elsewhere.
Swipe area is only considered for direct swipes (as in, not initiated by [class`SwipeGroup`]).
If not implemented, the default implementation returns the allocation of self, allowing swipes from anywhere.
New in version 1.0.
- do_get_swipe_tracker() virtual¶
- Returns:
the swipe tracker
- Return type:
Gets the [class`SwipeTracker`] used by this swipeable widget.
New in version 1.0.
- do_switch_child(index, duration) virtual¶
- Parameters:
Switches to child with index index.
See [signal`Swipeable`:py:func:::child-switched<Handy.Swipeable.signals.child_switched>].
New in version 1.0.
Signal Details¶
- Handy.Swipeable.signals.child_switched(swipeable, index, duration)¶
- Signal Name:
child-switched
- Flags:
- Parameters:
swipeable (
Handy.Swipeable
) – The object which received the signalindex (
int
) – the index of the child to switch toduration (
int
) – animation duration, in milliseconds
Emitted when the widget’s visible child is changed.
duration can be 0 if the child is switched without animation.
This is used by [class`SwipeGroup`], applications should not connect to it.
New in version 1.0.