pub enum Widget<L: Logic> {
Show 13 variants
Label {
text: L::Value,
style: LabelStyle,
},
Button {
title: L::Value,
style: ButtonStyle,
icon: Icon,
selected: Option<L::Value>,
action: L::Action,
},
TextField {
value: L::Binding,
placeholder: String,
lines: u32,
action: Option<L::Action>,
},
Checkbox {
checked: L::Binding,
title: Option<L::Value>,
style: ToggleStyle,
},
Slider {
value: L::Binding,
min: i64,
max: i64,
},
Picker {
selection: L::Binding,
options: L::Value,
},
NavItem {
title: L::Value,
value: L::Value,
selection: L::Binding,
icon: Icon,
badge: Option<L::Value>,
},
ContextMenu {
entries: Vec<MenuEntry<L::Action>>,
},
DropTarget {
dropped: L::Binding,
action: Option<L::Action>,
},
Image {
path: L::Value,
size: ImageSize,
},
Progress {
value: Option<L::Value>,
},
Spacer,
Divider,
}Variants§
Label
Button
Shown as selected while selected holds, when it has one.
TextField
Edits text on one line, or on lines lines when more. A one-line field with an
action runs it on Return.
Checkbox
Slider
Shows the number at value, from min to max, and writes the user’s pick there.
Picker
Shows selection among options, a list of text, and writes the user’s pick there.
Selected while selection holds value; picking it writes value there.
ContextMenu
A right-click menu for the stack it is in, whose items run their actions.
DropTarget
Takes files and links dropped on the stack it is in, writing them to dropped,
then runs action, if it has one.
Image
The image in the file at path, shown at size.
Progress
A progress bar at value percent, or busy without one.
Spacer
Divider
Trait Implementations§
Auto Trait Implementations§
impl<L> Freeze for Widget<L>
impl<L> RefUnwindSafe for Widget<L>where
<L as Logic>::Value: RefUnwindSafe,
<L as Logic>::Action: RefUnwindSafe,
<L as Logic>::Binding: RefUnwindSafe,
impl<L> Send for Widget<L>
impl<L> Sync for Widget<L>
impl<L> Unpin for Widget<L>
impl<L> UnsafeUnpin for Widget<L>where
<L as Logic>::Value: UnsafeUnpin,
<L as Logic>::Action: UnsafeUnpin,
<L as Logic>::Binding: UnsafeUnpin,
impl<L> UnwindSafe for Widget<L>where
<L as Logic>::Value: UnwindSafe,
<L as Logic>::Action: UnwindSafe,
<L as Logic>::Binding: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more