Adw.SwipeTracker¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/co |
|||
r/w/en |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted right before a swipe will be started, after the drag threshold has been passed. |
|
This signal is emitted as soon as the gesture has stopped. |
|
This signal is emitted when a possible swipe is detected. |
|
This signal is emitted every time the progress value changes. |
Fields¶
- Inherited:
Class Details¶
- class Adw.SwipeTracker(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A swipe tracker used in [class`Carousel`], [class`NavigationView`] and [class`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 [property`SwipeTracker`:py:data::enabled<Adw.SwipeTracker.props.enabled>] property. If they expect to use horizontal orientation, [property`SwipeTracker`:py:data::reversed<Adw.SwipeTracker.props.reversed>] can be used for supporting RTL text direction.
- classmethod new(swipeable)¶
- Parameters:
swipeable (
Adw.Swipeable
) – a widget to add the tracker on- Returns:
the newly created
AdwSwipeTracker
- Return type:
Creates a new
AdwSwipeTracker
for widget.
- get_allow_long_swipes()¶
- Returns:
whether long swipes are allowed
- Return type:
Gets whether to allow swiping for more than one snap point at a time.
- get_allow_mouse_drag()¶
- Returns:
whether mouse dragging is allowed
- Return type:
Gets whether self can be dragged with mouse pointer.
- get_allow_window_handle()¶
- Returns:
whether swiping from window handles is allowed
- Return type:
Gets whether to allow touchscreen swiping from
GtkWindowHandle
.New in version 1.5.
- get_lower_overshoot()¶
- Returns:
whether to allow swiping past the first available snap point
- Return type:
Gets whether to allow swiping past the first available snap point.
New in version 1.4.
- get_reversed()¶
- Returns:
whether the direction is reversed
- Return type:
Gets whether self is reversing the swipe direction.
- get_swipeable()¶
- Returns:
the swipeable widget
- Return type:
Get the widget self is attached to.
- get_upper_overshoot()¶
- Returns:
whether to allow swiping past the last available snap point
- Return type:
Gets whether to allow swiping past the last available snap point.
New in version 1.4.
- 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.
- set_allow_mouse_drag(allow_mouse_drag)¶
- Parameters:
allow_mouse_drag (
bool
) – whether to allow mouse dragging
Sets whether self can be dragged with mouse pointer.
- set_allow_window_handle(allow_window_handle)¶
- Parameters:
allow_window_handle (
bool
) – whether to allow swiping from window handles
Sets whether to allow touchscreen swiping from
GtkWindowHandle
.Setting it to
TRUE
will make dragging the window impossible.New in version 1.5.
- set_enabled(enabled)¶
- Parameters:
enabled (
bool
) – whether self is enabled
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.
- set_lower_overshoot(overshoot)¶
- Parameters:
overshoot (
bool
) – whether to allow swiping past the first available snap point
Sets whether to allow swiping past the first available snap point.
New in version 1.4.
- set_reversed(reversed)¶
- Parameters:
reversed (
bool
) – whether to reverse the swipe direction
Sets whether to reverse the swipe direction.
If the swipe tracker is horizontal, it can be used for supporting RTL text direction.
Signal Details¶
- Adw.SwipeTracker.signals.begin_swipe(swipe_tracker)¶
- Signal Name:
begin-swipe
- Flags:
- Parameters:
swipe_tracker (
Adw.SwipeTracker
) – The object which received the signal
This signal is emitted right before a swipe will be started, after the drag threshold has been passed.
- Adw.SwipeTracker.signals.end_swipe(swipe_tracker, velocity, to)¶
- Signal Name:
end-swipe
- Flags:
- Parameters:
swipe_tracker (
Adw.SwipeTracker
) – The object which received the signalvelocity (
float
) – the velocity of the swipeto (
float
) – the progress value to animate to
This signal is emitted as soon as the gesture has stopped.
The user is expected to animate the deceleration from the current progress value to to with an animation using velocity as the initial velocity, provided in pixels per second. [class`SpringAnimation`] is usually a good fit for this.
- Adw.SwipeTracker.signals.prepare(swipe_tracker, direction)¶
- Signal Name:
prepare
- Flags:
- Parameters:
swipe_tracker (
Adw.SwipeTracker
) – The object which received the signaldirection (
Adw.NavigationDirection
) – the direction of the swipe
This signal is emitted when a possible swipe is detected.
The direction value can be used to restrict the swipe to a certain direction.
- Adw.SwipeTracker.signals.update_swipe(swipe_tracker, progress)¶
- Signal Name:
update-swipe
- Flags:
- Parameters:
swipe_tracker (
Adw.SwipeTracker
) – The object which received the signalprogress (
float
) – the current animation progress value
This signal is emitted every time the progress value changes.
Property Details¶
- Adw.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.
- Adw.SwipeTracker.props.allow_mouse_drag¶
- Name:
allow-mouse-drag
- Type:
- Default Value:
- Flags:
Whether to allow dragging with mouse pointer.
- Adw.SwipeTracker.props.allow_window_handle¶
- Name:
allow-window-handle
- Type:
- Default Value:
- Flags:
Whether to allow touchscreen swiping from
GtkWindowHandle
.This will make dragging the window impossible.
New in version 1.5.
- Adw.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.
- Adw.SwipeTracker.props.lower_overshoot¶
- Name:
lower-overshoot
- Type:
- Default Value:
- Flags:
Whether to allow swiping past the first available snap point.
New in version 1.4.
- Adw.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.
- Adw.SwipeTracker.props.swipeable¶
- Name:
swipeable
- Type:
- Default Value:
- Flags:
The widget the swipe tracker is attached to.