[][src]Struct conrod_core::widget::list_select::ListSelect

pub struct ListSelect<M, D, S> { /* fields omitted */ }

A wrapper around the List widget that handles single and multiple selection logic.

Implementations

impl ListSelect<Single, Down, Dynamic>[src]

pub fn single(num_items: usize) -> Self[src]

Construct a new ListSelect, allowing one selected item at a time.

impl ListSelect<Multiple, Down, Dynamic>[src]

pub fn multiple(num_items: usize) -> Self[src]

Construct a new ListSelect, allowing multiple selected items.

impl<M, D, S> ListSelect<M, D, S> where
    M: Mode,
    D: Direction,
    S: ItemSize
[src]

pub fn flow_down(self) -> ListSelect<M, Down, S>[src]

Flows items from top to bottom.

pub fn flow_right(self) -> ListSelect<M, Right, S>[src]

Flows items from left to right.

pub fn flow_left(self) -> ListSelect<M, Left, S>[src]

Flows items from right to left.

pub fn flow_up(self) -> ListSelect<M, Up, S>[src]

Flows items from bottom to top.

pub fn item_size(self, length: Scalar) -> ListSelect<M, D, Fixed>[src]

Specify a fixed item size, where size is a Scalar in the direction that the List is flowing. When a List is constructed with this method, all items will have a fixed, equal length.

impl<M> ListSelect<M, Down, Dynamic>[src]

pub fn new(num_items: usize, mode: M) -> Self where
    M: Mode
[src]

Begin building a new ListSelect with the given mode.

This method is only useful when using a custom Mode, otherwise ListSelect::single or ListSelect::multiple will probably be more suitable.

impl<M, D, S> ListSelect<M, D, S>[src]

pub fn scrollbar_next_to(self) -> Self[src]

Specifies that the List should be scrollable and should provide a Scrollbar to the right of the items.

pub fn scrollbar_on_top(self) -> Self[src]

Specifies that the List should be scrollable and should provide a Scrollbar that hovers above the right edge of the items and automatically hides when the user is not scrolling.

pub fn scrollbar_thickness(self, w: Scalar) -> Self[src]

The width of the Scrollbar.

pub fn scrollbar_color(self, color: Color) -> Self[src]

The color of the Scrollbar.

impl<M, D> ListSelect<M, D, Fixed>[src]

pub fn instantiate_all_items(self) -> Self[src]

Indicates that an Item should be instatiated for every element in the list, regardless of whether or not the Item would be visible.

This is the default (and only) behaviour for Lists with dynamic item sizes. This is because a List cannot know the total length of its combined items in advanced when each item is dynamically sized and their size is not given until they are set.

Note: This may cause significantly heavier CPU load for lists containing many items (100+). We only recommend using this when absolutely necessary as large lists may cause unnecessary bloating within the widget graph, and in turn result in greater traversal times.

pub fn instantiate_only_visible_items(self) -> Self[src]

Indicates that only Items that are visible should be instantiated. This ensures that we avoid bloating the widget graph with unnecessary nodes and in turn keep traversal times to a minimum.

This is the default behaviour for ListSelects with fixed item sizes.

Trait Implementations

impl<M: Clone, D: Clone, S: Clone> Clone for ListSelect<M, D, S>[src]

impl<M, D, S> Common for ListSelect<M, D, S>[src]

impl<M, D, S> Widget for ListSelect<M, D, S> where
    M: Mode,
    D: Direction,
    S: ItemSize
[src]

type State = State

State to be stored within the Uis widget cache. Read more

type Style = Style

Every widget is required to have its own associated Style type. This type is intended to contain high-level styling information for the widget that can be optionally specified by a user of the widget. Read more

type Event = (Events<M, D, S>, Option<Scrollbar<D::Axis>>)

The type of event yielded by the widget, returned via the Widget::set function. Read more

fn update(self, args: UpdateArgs<'_, '_, '_, '_, Self>) -> Self::Event[src]

Update the state of the ListSelect.

Auto Trait Implementations

impl<M, D, S> RefUnwindSafe for ListSelect<M, D, S> where
    D: RefUnwindSafe,
    M: RefUnwindSafe,
    S: RefUnwindSafe

impl<M, D, S> Send for ListSelect<M, D, S> where
    D: Send,
    M: Send,
    S: Send

impl<M, D, S> Sync for ListSelect<M, D, S> where
    D: Sync,
    M: Sync,
    S: Sync

impl<M, D, S> Unpin for ListSelect<M, D, S> where
    D: Unpin,
    M: Unpin,
    S: Unpin

impl<M, D, S> UnwindSafe for ListSelect<M, D, S> where
    D: UnwindSafe,
    M: UnwindSafe,
    S: UnwindSafe

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<T> From<T> for T[src]

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

impl<W> Positionable for W where
    W: Widget
[src]

impl<W> Sizeable for W where
    W: Widget
[src]

fn get_x_dimension(&Self, &Ui) -> Dimension[src]

We attempt to retrieve the x Dimension for the widget via the following:

  • Check for specified value at maybe_x_dimension
  • Otherwise, use the default returned by Widget::default_x_dimension.

fn get_y_dimension(&Self, &Ui) -> Dimension[src]

We attempt to retrieve the y Dimension for the widget via the following:

  • Check for specified value at maybe_y_dimension
  • Otherwise, use the default returned by Widget::default_y_dimension.

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

type Owned = T

The resulting type after obtaining ownership.

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.