Crate cursive_extras

Source
Expand description

Crates.io

§Cursive Extras

Extra views for the Cursive TUI library as well some helper functions and macros

§Features

  • image_view: Enables the ImageView view
  • log_view: Enables the LogView view
  • tabs: Tabbed views similar to cursive-tabs
  • advanced: Advanced views

Macros§

adv_select_view
Convenience macro that makes AdvancedSelectViews easier to create
c_focus
Convenience macro that wraps a view in a CircularFocus that wraps the arrow keys
hlayout
Convenience macro that creates a horizontal layout of views
report_error
Convenience macro that updates the specified StatusView reference with an error message and returns from the current callback if an error happens, returns the Ok value otherwise
select_view
Convenience macro that makes SelectViews easier to create
settings
Convenience macro that generates a settings view using sub-views wrapped in a Dialog view
settings_cb
Same as the settings! macro, but allows for a custom confirmation text to be defined as well
tab_layer
Convenience macro to generate a TabLayer view
tabs
Convenience macro to generate a TabDialog view
vlayout
Convenience macro that creates a vertical layout of views

Structs§

AdvancedButton
A special button view that can be multiple lines, have data attached to it, and also accepts StyledStrings
AdvancedSelectView
A view that is a lot like a SelectView but allows mutable access to the selection and allows multiline items
HDivider
Horizontal divider view
ImageView
View that can render a low res image as text
LazyView
A view that lazily renders its contents
LoadingAnimation
Loading animation view that runs a task in a background thread and shows a loading animation and message while it completes and allows for retrieval of a return value. It is recommended to use load_resource() instead of this directly since it has a simpler interface
LogView
A special view that follows a specified log file similar to how tail -f <log file name> tracks a log file
StatusView
View that can be used to report an application’s status. It is meant to be placed at the bottom of the main Cursive layer
TabContainer
The internal view used by the tabbed views
TabDialog
A dialog-like view with tabs. This is very similar to the TabPanel view in cursive_tabs
TabLayer
A view similar to TabDialog but it fills up all the available space
VDivider
Vertical divider view

Traits§

SpannedStrExt
Extension trait for SpannedString and SpannedStr

Functions§

better_theme
Convenience function that generates a better looking Cursive theme
confirm_dialog
Convenience function that creates a dialog that runs a callback if the user selects “Yes”
filled_hspacer
Horizontal spacer fills all the available width
filled_vspacer
Vertical spacer fills all the available height
fixed_hspacer
Horizontal spacer with fixed width
fixed_vspacer
Vertical spacer with fixed height
get_checkbox_option
Convenience function that return the state of a named check box
info_dialog
Convenience function that shows a user a dialog box with a message that includes a back button
labeled_checkbox
Convenience function that returns a horizontal LinearLayout that is a named check box with a label
labeled_checkbox_cb
Same as labeled_checkbox() but also accepts a closure to execute when the check box’s state changes
load_resource
Convenience function that shows a loading pop up
styled_editview
Convenience function that creates a named EditView that has a better looking style and can optionally act as a password entry box
styled_editview_color
Same as styled_editview() but allows for a color to be chosen instead of using the highlight color

Type Aliases§

Spacer
A spacer between 2 views
TabIter
Iterator over the views and their IDs in a tabbed view
TabIterMut
Mutable iterator over the views and their IDs in a tabbed view
OSZAR »