Crate widgetry

source ·
Expand description

§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 menus
  • Button - clickable buttons with keybindings and tooltips
  • Toggle - checkboxes, switches, and other toggles
  • CompareTimes - a scatter plot specialized for comparing times
  • DragDrop - a reorderable row of draggable cards
  • DrawWithTooltips - draw static geometry, with mouse tooltips in certain regions
  • Dropdown - a button that expands into a menu
  • FanChart - visualize a range of values over time
  • Filler - just carve out space in the layout for something else
  • JustDraw (argh private) - just draw text, GeomBatches, SVGs
  • LinePlot - visualize 2 variables with a line plot
  • Menu - select something from a menu, with keybindings
  • PersistentSplit - a button with a dropdown to change its state
  • ScatterPlot - visualize 2 variables with a scatter plot
  • Slider - horizontal and vertical sliders
  • Spinner - numeric input with up/down buttons
  • table::Table - rows and columns, supporting filtering and pagination
  • TextBox - single line text entry

Re-exports§

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 🔒
  • canvas 🔒
  • color 🔒
  • drawing 🔒
  • event 🔒
  • event_ctx 🔒
  • geom 🔒
  • input 🔒
  • runner 🔒
  • style 🔒
  • svg 🔒
  • text 🔒
  • widgets 🔒

Macros§

Structs§

Enums§

Constants§

Traits§

  • Any data that should last the entire lifetime of the application should be stored in the struct implementing this trait.
  • Many states fit a pattern of managing a single panel, handling mouseover events, and other interactions on the map. Implementing this instead of State reduces some boilerplate.
  • A temporary state of an application. There’s a stack of these, with the most recent being the active one.
  • Create a new widget by implementing this trait. You can instantiate your widget by calling Widget::new(Box::new(instance of your new widget)), which gives you the usual style options.

Functions§

Type Aliases§