SwipeTracker#
Superclasses: Object
Implemented Interfaces: Orientable
A swipe tracker used in Carousel
, NavigationView
and
OverlaySplitView
.
The AdwSwipeTracker
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 the enabled
property. If they expect to use horizontal orientation,
reversed
can be used for supporting RTL text
direction.
Constructors#
- class SwipeTracker
- classmethod new(swipeable: Swipeable) SwipeTracker #
Creates a new
AdwSwipeTracker
forwidget
.- Parameters:
swipeable – a widget to add the tracker on
Methods#
- class SwipeTracker
- get_allow_long_swipes() bool #
Gets whether to allow swiping for more than one snap point at a time.
- get_allow_window_handle() bool #
Gets whether to allow touchscreen swiping from
GtkWindowHandle
.Added in version 1.5.
- get_lower_overshoot() bool #
Gets whether to allow swiping past the first available snap point.
Added in version 1.4.
- get_upper_overshoot() bool #
Gets whether to allow swiping past the last available snap point.
Added in version 1.4.
- set_allow_long_swipes(allow_long_swipes: bool) None #
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.- Parameters:
allow_long_swipes – whether to allow long swipes
- set_allow_mouse_drag(allow_mouse_drag: bool) None #
Sets whether
self
can be dragged with mouse pointer.- Parameters:
allow_mouse_drag – whether to allow mouse dragging
- set_allow_window_handle(allow_window_handle: bool) None #
Sets whether to allow touchscreen swiping from
GtkWindowHandle
.Setting it to
TRUE
will make dragging the window impossible.Added in version 1.5.
- Parameters:
allow_window_handle – whether to allow swiping from window handles
- set_enabled(enabled: bool) None #
Sets whether
self
is enabled.When it’s not enabled, no events will be processed. Usually widgets will want to expose this via a property.
- Parameters:
enabled – whether
self
is enabled
- set_lower_overshoot(overshoot: bool) None #
Sets whether to allow swiping past the first available snap point.
Added in version 1.4.
- Parameters:
overshoot – whether to allow swiping past the first available snap point
- set_reversed(reversed: bool) None #
Sets whether to reverse the swipe direction.
If the swipe tracker is horizontal, it can be used for supporting RTL text direction.
- Parameters:
reversed – whether to reverse the swipe direction
Properties#
- class SwipeTracker
Signals#
- class SwipeTracker.signals
-
- end_swipe(velocity: float, to: float) None #
The type of the None singleton.
- Parameters:
velocity – the velocity of the swipe
to – the progress value to animate to
- prepare(direction: NavigationDirection) None #
The type of the None singleton.
- Parameters:
direction – the direction of the swipe