Module widget

Module widget 

Source
Expand description

User interface widgets Widgets are defined using the Widget trait. You can choose to implement widgets yourself, or you can use the built in widgets defined in this module.

Since the whole Component every time it is mutated, most widgets need to keep track of some kind of state across rebuilds. This is managed automatically by the component, identified by the key method. When implementing custom widgets, you need to make sure that the returned u64 key is as unique as possible. You also need to make sure that the custom widgets do not remember absolute layouts. Widgets like Scroll can change the layout without needing a rebuild of the ui.

Modules§

button
A clickable button
column
Layout child widgets vertically
drag_drop
Drag and drop zones
dropdown
Pick an item from a dropdown box
dummy
Dummy widget that has a custom widget name
frame
A widget that wraps around a content widget
image
Just an image
input
Editable text input
layers
Stack child widgets on top of each other, while only the topmost receives events.
menu
A context menu with nestable items
panel
A panel with a fixed size and location within it’s parent
prelude
Prelude widgets
progress
A bar that fills up according to a value.
row
Layout child widgets horizontally
scroll
View a small section of larger widget, with scrollbars.
slider
A slider for easily picking some number
spacer
Empty widget
text
Widget that renders a paragraph of text.
toggle
A clickable button that toggles some bool.
window
A window with a title and a content widget that can be moved by dragging the title.

Structs§

Context
Context for posting messages and requesting redraws of the ui.

Traits§

Widget
A user interface widget.

Type Aliases§

StateVec
Storage for style states