Handy.SwipeTracker¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
Whether to allow swiping for more than one snap point at a time |
||
r/w/en |
Whether to allow dragging with mouse pointer |
||
r/w/en |
Whether the swipe tracker processes events |
||
r/w/en |
Whether swipe direction is reversed |
||
r/w/co |
The swipeable the swipe tracker is attached to |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when a possible swipe is detected. |
|
This signal is emitted as soon as the gesture has stopped. |
|
This signal is emitted every time the progress value changes. |
Fields¶
- Inherited:
Class Details¶
- class Handy.SwipeTracker(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Swipe tracker used in [class`Carousel`] and [class`Leaflet`].
The
HdySwipeTracker
object can be used for implementing widgets with swipe gestures. It supports touch-based swipes, pointer dragging, and touchpad scrolling.The widgets will probably want to expose [property`SwipeTracker`:py:data::enabled<Handy.SwipeTracker.props.enabled>] property. If they expect to use horizontal orientation, [property`SwipeTracker`:py:data::reversed<Handy.SwipeTracker.props.reversed>] property can be used for supporting RTL text direction.
New in version 1.0.
- classmethod new(swipeable)¶
- Parameters:
swipeable (
Handy.Swipeable
) – a swipeable to add the tracker on- Returns:
the newly created
HdySwipeTracker
- Return type:
Creates a new
HdySwipeTracker
object on widget.New in version 1.0.
- get_allow_long_swipes()¶
- Returns:
whether long swipes are allowed
- Return type:
Whether to allow swiping for more than one snap point at a time.
If the value is
FALSE
, each swipe can only move to the adjacent snap points.New in version 1.2.
- get_allow_mouse_drag()¶
- Returns:
TRUE
is mouse dragging is allowed- Return type:
Get whether self can be dragged with mouse pointer.
New in version 1.0.
- get_enabled()¶
- Returns:
TRUE
if self is enabled- Return type:
Get whether self is enabled.
New in version 1.0.
- get_reversed()¶
- Returns:
TRUE
is the direction is reversed- Return type:
Get whether self is reversing the swipe direction.
New in version 1.0.
- get_swipeable()¶
- Returns:
the swipeable widget
- Return type:
Get self's swipeable widget.
New in version 1.0.
- set_allow_long_swipes(allow_long_swipes)¶
- Parameters:
allow_long_swipes (
bool
) – whether to allow long swipes
Sets whether to allow swiping for more than one snap point at a time.
If the value is
FALSE
, each swipe can only move to the adjacent snap points.New in version 1.2.
- set_allow_mouse_drag(allow_mouse_drag)¶
- Parameters:
allow_mouse_drag (
bool
) – whether to allow mouse dragging
Set whether self can be dragged with mouse pointer.
This should usually be
FALSE
.New in version 1.0.
- set_enabled(enabled)¶
- Parameters:
enabled (
bool
) – whether to enable to swipe tracker
Set whether self is enabled.
New in version 1.0.
Signal Details¶
- Handy.SwipeTracker.signals.begin_swipe(swipe_tracker, direction, direct)¶
- Signal Name:
begin-swipe
- Flags:
- Parameters:
swipe_tracker (
Handy.SwipeTracker
) – The object which received the signaldirection (
Handy.NavigationDirection
) – the direction of the swipedirect (
bool
) –TRUE
if the swipe is directly triggered by a gesture,FALSE
if it’s triggered via a [class`SwipeGroup`]
This signal is emitted when a possible swipe is detected.
The direction value can be used to restrict the swipe to a certain direction.
New in version 1.0.
- Handy.SwipeTracker.signals.end_swipe(swipe_tracker, duration, to)¶
- Signal Name:
end-swipe
- Flags:
- Parameters:
swipe_tracker (
Handy.SwipeTracker
) – The object which received the signalduration (
int
) – snap-back animation duration, in millisecondsto (
float
) – the progress value to animate to
This signal is emitted as soon as the gesture has stopped.
New in version 1.0.
- Handy.SwipeTracker.signals.update_swipe(swipe_tracker, progress)¶
- Signal Name:
update-swipe
- Flags:
- Parameters:
swipe_tracker (
Handy.SwipeTracker
) – The object which received the signalprogress (
float
) – the current animation progress value
This signal is emitted every time the progress value changes.
New in version 1.0.
Property Details¶
- Handy.SwipeTracker.props.allow_long_swipes¶
- Name:
allow-long-swipes
- Type:
- Default Value:
- Flags:
Whether to allow swiping for more than one snap point at a time.
If the value is
FALSE
, each swipe can only move to the adjacent snap points.New in version 1.2.
- Handy.SwipeTracker.props.allow_mouse_drag¶
- Name:
allow-mouse-drag
- Type:
- Default Value:
- Flags:
Whether to allow dragging with mouse pointer.
This should usually be
FALSE
.New in version 1.0.
- Handy.SwipeTracker.props.enabled¶
- Name:
enabled
- Type:
- Default Value:
- Flags:
Whether the swipe tracker is enabled.
When it’s not enabled, no events will be processed. Usually widgets will want to expose this via a property.
New in version 1.0.
- Handy.SwipeTracker.props.reversed¶
- Name:
reversed
- Type:
- Default Value:
- Flags:
Whether to reverse the swipe direction.
If the swipe tracker is horizontal, it can be used for supporting RTL text direction.
New in version 1.0.
- Handy.SwipeTracker.props.swipeable¶
- Name:
swipeable
- Type:
- Default Value:
- Flags:
The widget the swipe tracker is attached to. Must not be
NULL
.New in version 1.0.