[]Struct gtk::EventControllerScroll

pub struct EventControllerScroll(_, _);

EventControllerScroll is an event controller meant to handle scroll events from mice and touchpads. It is capable of handling both discrete and continuous scroll events, abstracting them both on the EventControllerScroll::scroll signal (deltas in the discrete case are multiples of 1).

In the case of continuous scroll events, EventControllerScroll encloses all EventControllerScroll::scroll events between two EventControllerScroll::scroll-begin and EventControllerScroll::scroll-end signals.

The behavior of the event controller can be modified by the flags given at creation time, or modified at a later point through EventControllerScroll::set_flags (e.g. because the scrolling conditions of the widget changed).

The controller can be set up to emit motion for either/both vertical and horizontal scroll events through EventControllerScrollFlags::Vertical, EventControllerScrollFlags::Horizontal and GTK_EVENT_CONTROLLER_SCROLL_BOTH. If any axis is disabled, the respective EventControllerScroll::scroll delta will be 0. Vertical scroll events will be translated to horizontal motion for the devices incapable of horizontal scrolling.

The event controller can also be forced to emit discrete events on all devices through EventControllerScrollFlags::Discrete. This can be used to implement discrete actions triggered through scroll events (e.g. switching across combobox options).

The EventControllerScrollFlags::Kinetic flag toggles the emission of the EventControllerScroll::decelerate signal, emitted at the end of scrolling with two X/Y velocity arguments that are consistent with the motion that was received.

This object was added in 3.24.

Feature: v3_24

Implements

EventControllerExt, glib::object::ObjectExt

Implementations

impl EventControllerScroll[src]

pub fn new<P: IsA<Widget>>(
    widget: &P,
    flags: EventControllerScrollFlags
) -> EventControllerScroll
[src]

Creates a new event controller that will handle scroll events for the given widget.

Feature: v3_24

widget

a Widget

flags

behavior flags

Returns

a new EventControllerScroll

pub fn get_flags(&self) -> EventControllerScrollFlags[src]

Gets the flags conditioning the scroll controller behavior.

Feature: v3_24

Returns

the controller flags.

pub fn set_flags(&self, flags: EventControllerScrollFlags)[src]

Sets the flags conditioning scroll controller behavior.

Feature: v3_24

flags

behavior flags

pub fn connect_decelerate<F: Fn(&EventControllerScroll, f64, f64) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Emitted after scroll is finished if the EventControllerScrollFlags::Kinetic flag is set. vel_x and vel_y express the initial velocity that was imprinted by the scroll events. vel_x and vel_y are expressed in pixels/ms.

vel_x

X velocity

vel_y

Y velocity

pub fn connect_scroll<F: Fn(&EventControllerScroll, f64, f64) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Signals that the widget should scroll by the amount specified by dx and dy.

dx

X delta

dy

Y delta

pub fn connect_scroll_begin<F: Fn(&EventControllerScroll) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Signals that a new scrolling operation has begun. It will only be emitted on devices capable of it.

pub fn connect_scroll_end<F: Fn(&EventControllerScroll) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Signals that a new scrolling operation has finished. It will only be emitted on devices capable of it.

pub fn connect_property_flags_notify<F: Fn(&EventControllerScroll) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Trait Implementations

impl Clone for EventControllerScroll

impl Debug for EventControllerScroll

impl Display for EventControllerScroll[src]

impl Eq for EventControllerScroll

impl Hash for EventControllerScroll

impl IsA<EventController> for EventControllerScroll

impl Ord for EventControllerScroll

impl<T: ObjectType> PartialEq<T> for EventControllerScroll

impl<T: ObjectType> PartialOrd<T> for EventControllerScroll

impl StaticType for EventControllerScroll

Auto Trait Implementations

impl RefUnwindSafe for EventControllerScroll

impl !Send for EventControllerScroll

impl !Sync for EventControllerScroll

impl Unpin for EventControllerScroll

impl UnwindSafe for EventControllerScroll

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.