:right-sidebar: True SwipeTracker =================================================================== .. currentmodule:: gi.repository.Adw .. class:: SwipeTracker(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Orientable` A swipe tracker used in :obj:`~gi.repository.Adw.Carousel`\, :obj:`~gi.repository.Adw.NavigationView` and :obj:`~gi.repository.Adw.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 :obj:`~gi.repository.Adw.SwipeTracker.props.enabled` property. If they expect to use horizontal orientation, :obj:`~gi.repository.Adw.SwipeTracker.props.reversed` can be used for supporting RTL text direction. Constructors ------------ .. rst-class:: interim-class .. class:: SwipeTracker :no-index: .. classmethod:: new(swipeable: ~gi.repository.Adw.Swipeable) -> ~gi.repository.Adw.SwipeTracker Creates a new ``AdwSwipeTracker`` for ``widget``\. :param swipeable: a widget to add the tracker on Methods ------- .. rst-class:: interim-class .. class:: SwipeTracker :no-index: .. method:: get_allow_long_swipes() -> bool Gets whether to allow swiping for more than one snap point at a time. .. method:: get_allow_mouse_drag() -> bool Gets whether ``self`` can be dragged with mouse pointer. .. method:: get_allow_window_handle() -> bool Gets whether to allow touchscreen swiping from ``GtkWindowHandle``\. .. versionadded:: 1.5 .. method:: get_enabled() -> bool Gets whether ``self`` is enabled. .. method:: get_lower_overshoot() -> bool Gets whether to allow swiping past the first available snap point. .. versionadded:: 1.4 .. method:: get_reversed() -> bool Gets whether ``self`` is reversing the swipe direction. .. method:: get_swipeable() -> ~gi.repository.Adw.Swipeable Get the widget ``self`` is attached to. .. method:: get_upper_overshoot() -> bool Gets whether to allow swiping past the last available snap point. .. versionadded:: 1.4 .. method:: 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. :param allow_long_swipes: whether to allow long swipes .. method:: set_allow_mouse_drag(allow_mouse_drag: bool) -> None Sets whether ``self`` can be dragged with mouse pointer. :param allow_mouse_drag: whether to allow mouse dragging .. method:: 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. .. versionadded:: 1.5 :param allow_window_handle: whether to allow swiping from window handles .. method:: 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. :param enabled: whether ``self`` is enabled .. method:: set_lower_overshoot(overshoot: bool) -> None Sets whether to allow swiping past the first available snap point. .. versionadded:: 1.4 :param overshoot: whether to allow swiping past the first available snap point .. method:: 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. :param reversed: whether to reverse the swipe direction .. method:: set_upper_overshoot(overshoot: bool) -> None Sets whether to allow swiping past the last available snap point. .. versionadded:: 1.4 :param overshoot: whether to allow swiping past the last available snap point .. method:: shift_position(delta: float) -> None Moves the current progress value by ``delta``\. This can be used to adjust the current position if snap points move during the gesture. :param delta: the position delta Properties ---------- .. rst-class:: interim-class .. class:: SwipeTracker :no-index: .. attribute:: props.allow_long_swipes :type: bool The type of the None singleton. .. attribute:: props.allow_mouse_drag :type: bool The type of the None singleton. .. attribute:: props.allow_window_handle :type: bool The type of the None singleton. .. versionadded:: 1.5 .. attribute:: props.enabled :type: bool The type of the None singleton. .. attribute:: props.lower_overshoot :type: bool The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.reversed :type: bool The type of the None singleton. .. attribute:: props.swipeable :type: ~gi.repository.Adw.Swipeable The type of the None singleton. .. attribute:: props.upper_overshoot :type: bool The type of the None singleton. .. versionadded:: 1.4 Signals ------- .. rst-class:: interim-class .. class:: SwipeTracker.signals :no-index: .. method:: begin_swipe() -> None The type of the None singleton. .. method:: end_swipe(velocity: float, to: float) -> None The type of the None singleton. :param velocity: the velocity of the swipe :param to: the progress value to animate to .. method:: prepare(direction: ~gi.repository.Adw.NavigationDirection) -> None The type of the None singleton. :param direction: the direction of the swipe .. method:: update_swipe(progress: float) -> None The type of the None singleton. :param progress: the current animation progress value