[−][src]Crate widgetry
Widgets
If none of these do what you need, implementing a new WidgetImpl
isn't tough.
TODO inline pictures of some of these
Autocomplete
- select predefined value by combining text entry with menusButton
- clickable buttons with keybindings and tooltipsToggle
- checkboxes, switches, and other togglesCompareTimes
- a scatter plot specialized for comparing timesDrawWithTooltips
- draw static geometry, with mouse tooltips in certain regionsDropdown
- a button that expands into a menuFanChart
- visualize a range of values over timeFiller
- just carve out space in the layout for something elseJustDraw
(argh private) - just draw text,GeomBatch
es, SVGsLinePlot
- visualize 2 variables with a line plotMenu
- select something from a menu, with keybindingsMultiButton
- clickable regions in one batch of geometryPersistentSplit
- a button with a dropdown to change its stateScatterPlot
- visualize 2 variables with a scatter plotSlider
- horizontal and vertical slidersSpinner
- numeric input with up/down buttonstable::Table
- rows and columns, supporting filtering and paginationTextBox
- single line text entry
Modules
app_state | A widgetry application splits its state into two pieces: global shared state that lasts for the entire lifetime of the application, and a stack of smaller states, only one of which is active at a time. For example, imagine an application to view a map. The shared state would include the map and pre-rendered geometry for it. The individual states might start with a splash screen or menu to choose a map, then a map viewer, then maybe a state to drill down into pieces of the map. |
assets | |
backend | |
backend_glow | |
backend_glow_native | |
canvas | |
color | |
drawing | |
event | |
event_ctx | |
geom | |
input | |
runner | |
screen_geom | |
style | |
svg | |
table | |
text | |
tools | |
widgets |
Macros
include_labeled_bytes | Like |
Structs
Autocomplete | |
ButtonBuilder | |
ButtonStyle | |
Cached | Store a cached key/value pair, only recalculating when the key changes. |
Canvas | |
Choice | |
Color | |
CompareTimes | |
DrawWithTooltips | |
Drawable | Geometry that's been uploaded to the GPU once and can be quickly redrawn many times. Create by
creating a |
EdgeInsets | |
EventCtx | |
FanChart | |
Filler | Doesn't do anything by itself, just used for widgetsing. Something else reaches in, asks for the ScreenRectangle to use. |
GeomBatch | A mutable builder for a group of colored polygons. |
GfxCtx | |
Image | |
LinePlot | |
LinearGradient | |
Menu | |
MultiButton | |
Panel | |
PersistentSplit | |
PlotOptions | |
Prerender | |
ScatterPlot | |
ScreenDims | ScreenDims is in units of logical pixels, as opposed to physical pixels. |
ScreenPt | ScreenPt is in units of logical pixels, as opposed to physical pixels. |
ScreenRectangle | ScreenRectangle is in units of logical pixels, as opposed to physical pixels. |
Series | |
Settings | Customize how widgetry works. These settings can't be changed after starting. |
Slider | |
Spinner | |
Style | |
Text | |
TextSpan | |
Texture | |
Toggle | |
UserInput | |
Warper | |
Widget | |
WidgetOutput |
Enums
ContentMode | Rules for how content should stretch to fill its bounds |
ControlState | |
CornerRounding | |
DrawBaselayer | Before |
Event | |
Fill | |
Font | |
HorizontalAlignment | |
Key | |
MultiKey | |
Outcome | |
RewriteColor | A way to transform all colors in a GeomBatch. |
Transition | When a state responds to an event, it can specify some way to manipulate the stack of states. |
UpdateType | |
VerticalAlignment |
Traits
SharedAppState | Any data that should last the entire lifetime of the application should be stored in the struct implementing this trait. |
SimpleState | Many states fit a pattern of managing a single panel, handling mouseover events, and other
interactions on the map. Implementing this instead of |
State | A temporary state of an application. There's a stack of these, with the most recent being the active one. |
StyledButtons | |
TextExt | |
WidgetImpl | Create a new widget by implementing this trait. You can instantiate your widget by calling
|
Functions
Line | |
hotkeys | |
lctrl | |
run |
Type Definitions
OutlineStyle |