[][src]Struct libhandy4::Carousel

pub struct Carousel(_);

Implementations

impl Carousel[src]

pub fn new() -> Carousel[src]

Create a new Carousel widget.

Returns

The newly created Carousel widget

pub fn append<P: IsA<Widget>>(&self, child: &P)[src]

Appends child to self

child

a widget to add

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

Sets whether self can be dragged with mouse pointer

Returns

true if self can be dragged with mouse

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

Gets animation duration used by Carousel::scroll_to.

Returns

Animation duration in milliseconds

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

Gets whether self can be navigated.

Returns

true if self can be swiped

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

Gets the number of pages in self.

Returns

The number of pages in self

pub fn get_nth_page(&self, n: u32) -> Option<Widget>[src]

Gets the page at position n.

n

index of the page

Returns

the page

pub fn get_position(&self) -> f64[src]

Gets current scroll position in self. It's unitless, 1 matches 1 page.

Returns

The scroll position

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

Gets duration of the animation used when adding or removing pages in milliseconds.

Returns

Page reveal duration

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

Gets spacing between pages in pixels.

Returns

Spacing between pages

pub fn insert<P: IsA<Widget>>(&self, child: &P, position: i32)[src]

Inserts child into self at position position.

If position is -1, or larger than the number of pages, child will be appended to the end.

child

a widget to add

position

the position to insert child in.

pub fn prepend<P: IsA<Widget>>(&self, child: &P)[src]

Prepends child to self

child

a widget to add

pub fn remove<P: IsA<Widget>>(&self, child: &P)[src]

Removes child from self

child

a widget to remove

pub fn reorder<P: IsA<Widget>>(&self, child: &P, position: i32)[src]

Moves child into position position.

If position is -1, or larger than the number of pages, child will be moved to the end.

child

a widget to add

position

the position to move child to.

pub fn scroll_to<P: IsA<Widget>>(&self, widget: &P)[src]

Scrolls to widget position with an animation. Carousel:animation-duration property can be used for controlling the duration.

widget

a child of self

pub fn scroll_to_full<P: IsA<Widget>>(&self, widget: &P, duration: i64)[src]

Scrolls to widget position with an animation.

widget

a child of self

duration

animation duration in milliseconds

pub fn set_allow_mouse_drag(&self, allow_mouse_drag: bool)[src]

Sets whether self can be dragged with mouse pointer. If allow_mouse_drag is false, dragging is only available on touch.

allow_mouse_drag

whether self can be dragged with mouse pointer

pub fn set_animation_duration(&self, duration: u32)[src]

Sets animation duration used by Carousel::scroll_to.

duration

animation duration in milliseconds

pub fn set_interactive(&self, interactive: bool)[src]

Sets whether self can be navigated. This can be used to temporarily disable a Carousel to only allow swiping in a certain state.

interactive

whether self can be swiped.

pub fn set_reveal_duration(&self, reveal_duration: u32)[src]

Sets duration of the animation used when adding or removing pages in milliseconds.

reveal_duration

the new reveal duration value

pub fn set_spacing(&self, spacing: u32)[src]

Sets spacing between pages in pixels.

spacing

the new spacing value

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

This signal is emitted after a page has been changed. This can be used to implement "infinite scrolling" by connecting to this signal and amending the pages.

index

Current page

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

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

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

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

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

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

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

Trait Implementations

impl Clone for Carousel[src]

impl Debug for Carousel[src]

impl Default for Carousel[src]

impl Display for Carousel[src]

impl Eq for Carousel[src]

impl Hash for Carousel[src]

impl IsA<Accessible> for Carousel[src]

impl IsA<Buildable> for Carousel[src]

impl IsA<ConstraintTarget> for Carousel[src]

impl IsA<Orientable> for Carousel[src]

impl IsA<Swipeable> for Carousel[src]

impl IsA<Widget> for Carousel[src]

impl Ord for Carousel[src]

impl ParentClassIs for Carousel[src]

type Parent = Widget

impl<T: ObjectType> PartialEq<T> for Carousel[src]

impl<T: ObjectType> PartialOrd<T> for Carousel[src]

impl StaticType for Carousel[src]

impl StructuralEq for Carousel[src]

Auto Trait Implementations

impl RefUnwindSafe for Carousel[src]

impl !Send for Carousel[src]

impl !Sync for Carousel[src]

impl Unpin for Carousel[src]

impl UnwindSafe for Carousel[src]

Blanket Implementations

impl<O> AccessibleExt for O where
    O: IsA<Accessible>, 

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<O> BuildableExt for O where
    O: IsA<Buildable>, 

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

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

impl<O> ConstraintTargetExt for O where
    O: IsA<ConstraintTarget>, 

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<O> OrientableExt for O where
    O: IsA<Orientable>, 

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.

impl<O> WidgetExt for O where
    O: IsA<Widget>, 

impl<O> WidgetExtManual for O where
    O: IsA<Widget>,