#[repr(C)]pub struct TemplateDesc {Show 19 fields
pub kind: TemplateKind,
pub button: ButtonStyle,
pub icon: Icon,
pub deps: Slice<u32>,
pub stack: StackStyle,
pub label: LabelStyle,
pub image: ImageSize,
pub text: Option<ReadFn>,
pub value: Option<ReadFn>,
pub badge: Option<ReadFn>,
pub binding: BindingDesc,
pub min: i64,
pub max: i64,
pub lines: u32,
pub action: Option<ActionFn>,
pub placeholder: Str,
pub children: Slice<TemplateDesc>,
pub menu: Slice<MenuEntryDesc>,
pub region: RegionDesc,
}Expand description
One element of a window’s UI. Which fields matter depends on kind:
StackandScroll:stackandchildren.Label:labelandtext.Button:button,icon,textas its title,action, andvalueas whether it is selected, if it shows that.TextField:binding,placeholder,lines, andactionto run on Return, if it has one.CheckboxandSwitch:binding, andtextas its title if it has one.Slider:bindingto its value, frommintomax.Picker:bindingto its selection, andvalueas its list of options.NavItem:textas its title,value,bindingas its selection,icon, andbadgeif it has one.Image:textas its file’s path, andimage.Progress:valueas its percentage, if it has one.ContextMenu:menu.DropTarget:bindingto the list it writes, andactionto run then, if any.Region:region.
deps are the state ids whose changes require showing a widget again, or rebuilding a
region.
Fields§
§kind: TemplateKind§icon: Icon§deps: Slice<u32>§stack: StackStyle§label: LabelStyle§image: ImageSize§text: Option<ReadFn>§value: Option<ReadFn>§badge: Option<ReadFn>§binding: BindingDesc§min: i64§max: i64§lines: u32§action: Option<ActionFn>§placeholder: Str§children: Slice<TemplateDesc>§region: RegionDescImplementations§
Source§impl TemplateDesc
impl TemplateDesc
Sourcepub const fn empty(kind: TemplateKind) -> Self
pub const fn empty(kind: TemplateKind) -> Self
A template of kind with every other field empty, to build on.
Trait Implementations§
Auto Trait Implementations§
impl !Send for TemplateDesc
impl Freeze for TemplateDesc
impl RefUnwindSafe for TemplateDesc
impl Sync for TemplateDesc
impl Unpin for TemplateDesc
impl UnsafeUnpin for TemplateDesc
impl UnwindSafe for TemplateDesc
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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