: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` :Constructors: :: SwipeTracker(**properties) new(swipeable:Adw.Swipeable) -> Adw.SwipeTracker 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 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. .. attribute:: props.allow_mouse_drag :type: bool Whether to allow dragging with mouse pointer. .. attribute:: props.allow_window_handle :type: bool Whether to allow touchscreen swiping from ``GtkWindowHandle``. This will make dragging the window impossible. .. versionadded:: 1.5 .. attribute:: props.enabled :type: bool 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. .. attribute:: props.lower_overshoot :type: bool Whether to allow swiping past the first available snap point. .. versionadded:: 1.4 .. attribute:: props.reversed :type: bool Whether to reverse the swipe direction. If the swipe tracker is horizontal, it can be used for supporting RTL text direction. .. attribute:: props.swipeable :type: ~gi.repository.Adw.Swipeable The widget the swipe tracker is attached to. .. attribute:: props.upper_overshoot :type: bool Whether to allow swiping past the last available snap point. .. versionadded:: 1.4 Signals ------- .. rst-class:: interim-class .. class:: SwipeTracker.signals :no-index: .. method:: begin_swipe() -> None This signal is emitted right before a swipe will be started, after the drag threshold has been passed. .. method:: end_swipe(velocity: float, to: float) -> None 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. :obj:`~gi.repository.Adw.SpringAnimation` is usually a good fit for this. :param velocity: the velocity of the swipe :param to: the progress value to animate to .. method:: prepare(direction: ~gi.repository.Adw.NavigationDirection) -> None This signal is emitted when a possible swipe is detected. The ``direction`` value can be used to restrict the swipe to a certain direction. :param direction: the direction of the swipe .. method:: update_swipe(progress: float) -> None This signal is emitted every time the progress value changes. :param progress: the current animation progress value