adw.swipeable_mixin

Module for [Swipeable] interface mixin

Templates 2

tmplSwipeableT()

An interface for swipeable widgets.

The [adw.swipeable.Swipeable] interface is implemented by all swipeable widgets.

See class@SwipeTracker for details about implementing it.

Functions
double getCancelProgress()

Gets the progress self will snap back to after the gesture is canceled.

Returns

the cancel progress, unitless
double getDistance()

Gets the swipe distance of self.

This corresponds to how many pixels 1 unit represents.

Returns

the swipe distance in pixels
double getProgress()

Gets the current progress of self.

Returns

the current progress, unitless
double[] getSnapPoints()

Gets the snap points of self.

Each snap point represents a progress value that is considered acceptable to end the swipe on.

Returns

the snap points
void getSwipeArea(adw.types.NavigationDirection navigationDirection, bool isDrag, out gdk.rectangle.Rectangle rect)

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.

If not implemented, the default implementation returns the allocation of self, allowing swipes from anywhere.

Parameters

navigationDirectionthe direction of the swipe
isDragwhether the swipe is caused by a dragging gesture
recta pointer to a rectangle to store the swipe area
tmplSwipeableGidBuilderT()