Crate cursive_extras
source ·Expand description
Cursive Extras
Extra views for the Cursive TUI library as well some helper functions and macros
Features
image_view: Enables theImageViewviewlog_view: Enables theLogViewviewtabs: Tabbed views similar tocursive-tabsbuffered_backend: Enables a termion based buffered backendadvanced: Advanced views
Note: buffered-backend is automatically enabled when image-view is enabled
Macros
- Convenience macro that makes
AdvancedSelectViews easier to create - Convenience macro that wraps a view in a
CircularFocusthat wraps the arrow keys - Convenience macro that creates a horizontal layout of views
- Convenience macro that updates the specified
StatusViewreference with an error message and returns from the current callback if an error happens, returns theOkvalue otherwise - Convenience macro that makes
SelectViews easier to create - Convenience macro that generates a settings view using sub-views wrapped in a
Dialogview - Same as the
settings!macro, but allows for a custom confirmation text to be defined as well - Convenience macro to generate a
TabLayerview - Convenience macro to generate a
TabDialogview - Convenience macro that creates a vertical layout of views
Structs
- A special button view that can be multiple lines, have data attached to it, and also accepts
StyledStrings - A view that is a lot like a
SelectViewbut allows mutable access to the selection and allows multiline items - Horizontal divider view
- View that can render a low res image as text
- 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 - A special view that follows a specified log file similar to how
tail -f <log file name>tracks a log file - 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
- The internal view used by the tabbed views
- A dialog-like view with tabs. This is very similar to the
TabPanelview incursive_tabs - A view similar to
TabDialogbut it fills up all the available space - Vertical divider view
Traits
- Extension trait for
SpannedStringandSpannedStr
Functions
- Convenience function that generates a better looking Cursive theme
- Creates a termion-based buffered backend cursive root using the
cursive_buffered_backendcrate - Convenience function that creates a dialog that runs a callback if the user selects “Yes”
- Horizontal spacer fills all the available width
- Vertical spacer fills all the available height
- Horizontal spacer with fixed width
- Vertical spacer with fixed height
- Convenience function that return the state of a named check box
- Convenience function that shows a user a dialog box with a message that includes a back button
- Convenience function that returns a horizontal
LinearLayoutthat is a named check box with a label - Same as
labeled_checkbox()but also accepts a closure to execute when the check box’s state changes - Convenience function that shows a loading pop up
- Convenience function that creates a named
EditViewthat has a better looking style and can optionally act as a password entry box - Same as
styled_editview()but allows for a color to be chosen instead of using the highlight color
Type Aliases
- A spacer between 2 views
- Iterator over the views and their IDs in a tabbed view
- Mutable iterator over the views and their IDs in a tabbed view