Expand description
Widget types and styling.
Structs§
- Style
- Visual and layout style for a widget.
- TextBox
- A text box’s content and editing state, as drawn this frame. Built by
text_box(text, placeholder, max length, event names); the caret, selection and horizontal scroll are filled in each frame byTextBoxState::apply. - Widget
- A single widget in the UI tree.
Enums§
- Dock
- WinForms-style dock — which edge(s) the widget attaches to inside its parent.
- Focus
Style - How a focused widget shows its focus indicator.
- Units
- A size value — either a fixed pixel amount, a CSS-style percentage of the
parent’s own resolved content size (0.0–100.0), or
Auto(size to content/available space, this crate’s original behaviour). - Widget
Kind
Constants§
- PLACEHOLDER_
COLOR - Placeholder text color of a text box.
- SELECTION_
COLOR - Selection highlight behind selected text.
- TEXT_
BOX_ BORDER - Border of an unfocused text box (vanilla
EditBox). - TEXT_
BOX_ FOCUS_ BORDER - Border of a focused text box unless
focus_coloris set.
Functions§
- button
- inv_
slot - An inventory-slot decoration (icon + stack-count overlay) for
item_id(empty string = empty slot) withcountitems. Purely decorative — real drag-and-drop still goes through the vanillaSlotthis overlays. - item_
slot - label
- mc_
image - panel
- scroll_
view - A vertically scrolling column: clips its children, scrolls them by
Widget::scroll_yand draws a scrollbar when they overflow — WPF’sScrollVieweraround aStackPanel. Give it a fixed (or flex) height. - spacer
- text_
box - A single-line text input holding
text— black box, grey border (white while focused), like vanilla’sEditBox. Its text, caret and focus live in aTextBoxStatethat the code-behind keeps and applies to it each frame.