pub enum WidgetKind {
Panel(FlexDir),
Grid(Box<GridSpec>),
Label(String),
Button(String),
ItemSlot(String),
InvSlot {
item_id: String,
count: u32,
},
Image(Image),
Spacer,
Surface(String),
TextBox(TextBox),
}Variants§
Panel(FlexDir)
Container — arranges children according to flex_dir.
Grid(Box<GridSpec>)
Container — WPF’s Grid: rows and columns sized in pixels, to
content (Auto) or as shares of the rest (*); each child sits in
the cell(s) its Style::cell names — see grid and
GridSpec.
Label(String)
Static or dynamic text label.
Button(String)
Clickable button with text.
ItemSlot(String)
Minecraft item icon (static, known at build time).
InvSlot
Inventory-slot decoration: an item icon plus a stack-count overlay,
both supplied as plain data at tree-build time (like every other
widget here) — this crate has no notion of “the currently open menu”
or how to query it; that’s the caller’s job (see yog-inventory).
Empty item_id draws an empty slot box.
Image(Image)
An image from a Yog image source (item:apple, sprite:button,
mymod:gui/logo, …) — see Image and image.
Spacer
Invisible spacer.
Surface(String)
Drawn by the code: the Surface registered under
this id (see crate::surface and surface).
TextBox(TextBox)
Single-line text input — see TextBox and
TextBoxState, which owns the text and drives it.
Trait Implementations§
Source§impl Clone for WidgetKind
impl Clone for WidgetKind
Source§fn clone(&self) -> WidgetKind
fn clone(&self) -> WidgetKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more