[−][src]Trait libhandy4::SwipeableExt
Required methods
pub fn emit_child_switched(&self, index: u32, duration: i64)
[src]
Emits HdySwipeable::child-switched signal. This should be called when the widget switches visible child widget.
duration
can be 0 if the child is switched without animation.
index
the index of the child to switch to
duration
Animation duration in milliseconds
pub fn get_cancel_progress(&self) -> f64
[src]
Gets the progress self
will snap back to after the gesture is canceled.
Returns
the cancel progress, unitless
pub fn get_distance(&self) -> f64
[src]
Gets the swipe distance of self
. This corresponds to how many pixels
1 unit represents.
Returns
the swipe distance in pixels
pub fn get_progress(&self) -> f64
[src]
pub fn get_snap_points(&self) -> Vec<f64>
[src]
Gets the snap points of self
. Each snap point represents a progress value
that is considered acceptable to end the swipe on.
n_snap_points
location to return the number of the snap points
Returns
the snap points of
self
. The array must be freed with g_free
.
pub fn get_swipe_area(
&self,
navigation_direction: NavigationDirection,
is_drag: bool
) -> Rectangle
[src]
&self,
navigation_direction: NavigationDirection,
is_drag: bool
) -> Rectangle
Gets the area self
can start a swipe from for the given direction and
gesture type.
This can be used to restrict swipes to only be possible from a certain area,
for example, to only allow edge swipes, or to have a draggable element and
ignore swipes elsewhere.
Swipe area is only considered for direct swipes (as in, not initiated by
SwipeGroup
).
If not implemented, the default implementation returns the allocation of
self
, allowing swipes from anywhere.
navigation_direction
the direction of the swipe
is_drag
whether the swipe is caused by a dragging gesture
rect
a pointer to a gdk::Rectangle
to store the swipe area
pub fn get_swipe_tracker(&self) -> Option<SwipeTracker>
[src]
pub fn switch_child(&self, index: u32, duration: i64)
[src]
See HdySwipeable::child-switched.
index
the index of the child to switch to
duration
Animation duration in milliseconds
pub fn connect_child_switched<F: Fn(&Self, u32, i64) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
Implementors
impl<O: IsA<Swipeable>> SwipeableExt for O
[src]
pub fn emit_child_switched(&self, index: u32, duration: i64)
[src]
pub fn get_cancel_progress(&self) -> f64
[src]
pub fn get_distance(&self) -> f64
[src]
pub fn get_progress(&self) -> f64
[src]
pub fn get_snap_points(&self) -> Vec<f64>
[src]
pub fn get_swipe_area(
&self,
navigation_direction: NavigationDirection,
is_drag: bool
) -> Rectangle
[src]
&self,
navigation_direction: NavigationDirection,
is_drag: bool
) -> Rectangle
pub fn get_swipe_tracker(&self) -> Option<SwipeTracker>
[src]
pub fn switch_child(&self, index: u32, duration: i64)
[src]
pub fn connect_child_switched<F: Fn(&Self, u32, i64) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId