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);
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]
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]
F: 'static + Fn(&Self, &Actor),
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]
F: 'static + Fn(&Self, &Actor, LongPressState) -> bool,
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]
F: 'static + Fn(&Self),
pub fn connect_property_long_press_duration_notify<F>(
&self,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
&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),
[src]
&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),
[src]
F: 'static + Fn(&Self),
Implementors
impl<O> ClickActionExt for O where
O: IsA<ClickAction>,
[src]
impl<O> ClickActionExt for O where
O: IsA<ClickAction>,
[src]pub fn get_button(&self) -> u32
[src]
pub fn get_coords(&self) -> (f32, f32)
[src]
pub fn get_state(&self) -> ModifierType
[src]
pub fn release(&self)
[src]
pub fn get_property_held(&self) -> bool
[src]
pub fn get_property_long_press_duration(&self) -> i32
[src]
pub fn set_property_long_press_duration(&self, long_press_duration: i32)
[src]
pub fn get_property_long_press_threshold(&self) -> i32
[src]
pub fn set_property_long_press_threshold(&self, long_press_threshold: i32)
[src]
pub fn get_property_pressed(&self) -> bool
[src]
pub fn connect_clicked<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O, &Actor),
[src]
F: 'static + Fn(&O, &Actor),
pub fn connect_long_press<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O, &Actor, LongPressState) -> bool,
[src]
F: 'static + Fn(&O, &Actor, LongPressState) -> bool,
pub fn connect_property_held_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_long_press_duration_notify<F>(
&self,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
&self,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&O),
pub fn connect_property_long_press_threshold_notify<F>(
&self,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
&self,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&O),
pub fn connect_property_pressed_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),