Trait ux::ClickActionExt[][src]

pub trait ClickActionExt: 'static {
Show methods pub fn get_button(&self) -> u32;
pub fn get_coords(&self) -> (f32, f32);
pub fn get_state(&self) -> ModifierType;
pub fn release(&self);
pub fn get_property_held(&self) -> bool;
pub fn get_property_long_press_duration(&self) -> i32;
pub fn set_property_long_press_duration(&self, long_press_duration: i32);
pub fn get_property_long_press_threshold(&self) -> i32;
pub fn set_property_long_press_threshold(&self, long_press_threshold: i32);
pub fn get_property_pressed(&self) -> bool;
pub fn connect_clicked<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self, &Actor)
;
pub fn connect_long_press<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self, &Actor, LongPressState) -> bool
;
pub fn connect_property_held_notify<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_long_press_duration_notify<F>(
        &self,
        f: F
    ) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_long_press_threshold_notify<F>(
        &self,
        f: F
    ) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_pressed_notify<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
}

Trait containing all ClickAction methods.

Implementors

ClickAction

Required methods

pub fn get_button(&self) -> u32[src]

Retrieves the button that was pressed.

  • 1 - left mouse button in a right-handed configuration, or the right mouse button in a left-handed configuration
  • 2 - scroll wheel button
  • 3 - right mouse button in a right-handed configuration, or the left mouse button in a left-handed configuration

Returns

the button value

pub fn get_coords(&self) -> (f32, f32)[src]

Retrieves the screen coordinates of the button press.

press_x

return location for the X coordinate, or None

press_y

return location for the Y coordinate, or None

pub fn get_state(&self) -> ModifierType[src]

Retrieves the modifier state of the click action.

Returns

the modifier state parameter, or 0

pub fn release(&self)[src]

Emulates a release of the pointer button, which ungrabs the pointer and unsets the ClickAction:pressed state.

This function will also cancel the long press gesture if one was initiated.

This function is useful to break a grab, for instance after a certain amount of time has passed.

pub fn get_property_held(&self) -> bool[src]

Whether the clickable actor has the pointer grabbed

pub fn get_property_long_press_duration(&self) -> i32[src]

The minimum duration of a press for it to be recognized as a long press gesture, in milliseconds.

A value of -1 will make the ClickAction use the value of the Settings:long-press-duration property.

pub fn set_property_long_press_duration(&self, long_press_duration: i32)[src]

The minimum duration of a press for it to be recognized as a long press gesture, in milliseconds.

A value of -1 will make the ClickAction use the value of the Settings:long-press-duration property.

pub fn get_property_long_press_threshold(&self) -> i32[src]

The maximum allowed distance that can be covered (on both axes) before a long press gesture is cancelled, in pixels.

A value of -1 will make the ClickAction use the value of the Settings:dnd-drag-threshold property.

pub fn set_property_long_press_threshold(&self, long_press_threshold: i32)[src]

The maximum allowed distance that can be covered (on both axes) before a long press gesture is cancelled, in pixels.

A value of -1 will make the ClickAction use the value of the Settings:dnd-drag-threshold property.

pub fn get_property_pressed(&self) -> bool[src]

Whether the clickable actor should be in “pressed” state

pub fn connect_clicked<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self, &Actor), 
[src]

The ::clicked signal is emitted when the Actor to which a ClickAction has been applied should respond to a pointer button press and release events

actor

the Actor attached to the action

pub fn connect_long_press<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self, &Actor, LongPressState) -> bool
[src]

The ::long-press signal is emitted during the long press gesture handling.

This signal can be emitted multiple times with different states.

The LongPressState::Query state will be emitted on button presses, and its return value will determine whether the long press handling should be initiated. If the signal handlers will return true, the LongPressState::Query state will be followed either by a signal emission with the LongPressState::Activate state if the long press constraints were respected, or by a signal emission with the LongPressState::Cancel state if the long press was cancelled.

It is possible to forcibly cancel a long press detection using ClickActionExt::release.

actor

the Actor attached to the action

state

the long press state

Returns

Only the LongPressState::Query state uses the returned value of the handler; other states will ignore it

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

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

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

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

Loading content...

Implementors

impl<O> ClickActionExt for O where
    O: IsA<ClickAction>, 
[src]

Loading content...