[][src]Enum gazpatcho::config::Widget

pub enum Widget {
    MultilineInput {
        key: String,
        capacity: usize,
        size: [f32; 2],
    },
    Slider {
        key: String,
        min: f32,
        max: f32,
        format: String,
        width: f32,
    },
    Trigger {
        key: String,
        label: String,
    },
    Switch {
        key: String,
        label: String,
    },
    DropDown {
        key: String,
        items: Vec<DropDownItem>,
    },
}

Widgets are input dialogs shown on a node.

Each widget must have a unique key within the node it's registered to. This key is then used to read values recorded by the user.

Variants

MultilineInput

Multiline input provides text box for the user to type into and record a String.

Fields of MultilineInput

key: Stringcapacity: usize

Maximum capacity that the widget will allow.

size: [f32; 2]

Width and height of the widget shown in a node. The width will be treated as a minimal weight that may be increased in case there is another widget that is wider.

Slider

Slider is a drag and drop dialog allowing users to dial-in a f32 value within given borders.

Fields of Slider

key: Stringmin: f32

Minimum allowed value.

max: f32

Maximum allowed value.

format: String

Format of the shown value as C-format string. e.g. %.3f.

width: f32

Minimal width of the widget. The width may be increased in case the node contains another widget that is wider.

Trigger

Trigger is nothing but a simple button. When clicked, it sets value of given key to true. When released, it turns back to false.

Fields of Trigger

key: Stringlabel: String

Label shown on the button.

Switch

Switch is nothing but a simple button. When clicked, it sets value of given key to true. When clicked again, it turns back to false.

Fields of Switch

key: Stringlabel: String

Label shown on the button.

DropDown

Drop down menu allows user to select one of the available values.

Fields of DropDown

key: Stringitems: Vec<DropDownItem>

List of values to choose from.

Auto Trait Implementations

impl RefUnwindSafe for Widget

impl Send for Widget

impl Sync for Widget

impl Unpin for Widget

impl UnwindSafe for Widget

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<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.