- Added "inactive highlight" property to SelectView.
- Added
{Theme, Palette}::{retro, terminal_default}()
. - Added convenient method to create
Style
, similar toColorStyle
. - Added
{ColorStyle, Style}::view()
with Primary/View colors. - Added methods to create
RadioButton
using a key&str
, rather than relying on sharedRadioGroup
. - Many views now support using
StyledString
instead of just plainString
.- Menu entries
- Buttons
- Dialog titles and buttons
- Panel title
- Radio button labels
- Fixed a focus update in
SelectView
that could result in no entry being selected. - Fixed endless loop in
MenuPopup
(from the menubar for example) when all entries are disabled.
Style::{highlight, highlight_inactive}
now rely onEffect::Reverse
.- Most styles have been changed to use
InheritParent
for their background.Layer
now explicitly usesPaletteColor::View
.
Printer::print_styled
now takesS: Into<SpannedStr>
rather than aSpannedStr
directly. This lets it directly takes&StyledString
as input.
- Updates termion to 2.0
- Removed unused (and unmaintainted)
term_size
dependency. - Added a
status_bar
example.
- Crossterm backend: properly reset the color when de-initializing.
- Add
ColorStyle::{map, zip_map}
- Add
ColorStyle::invert
- Add
impl From<BaseColor> for ColorType
- Added more doc and doc tests to
ColorStyle
. - Add a Minimum Supported Rust Version to Cargo.toml for a better error message on old toolchains.
- Fix the
immut3!
macro. - Reset the running state when using non-default runners.
- Fix
ListView
behaviour with delimiters. - Reset focus field when clearing
LinearLayout
. - Fix scroll operation using outdated size if the child view was modified.
- Updates crossterm to 0.25.0
- First release
- Termion backend: properly revert terminal to blocking when exiting application.
- Added an ANSI color code parser
- Added some examples:
advanced_user_data
ansi
theme_editor
- Improved documentation for Printer
- Updates crossterm to 0.24.0
- SelectView now caches its required size for improved performance.
- Fix focused state in
FixedLayoutView
.
- Fix layout size inside
ScrollView
.
- Updated crossterm to 0.23.0
- Fix focus for
SelectView::insert_item
. - Fix scroll offset before the first layout call.
- Fix ResizedView to never give a larger size than available.
- Fix title layout for Panel when the space is limited
- Add getters & other utility methods to Dialog
- Add enabled state to menu items
- Add a
reexports
module with re-exports of crates used in public API - Add
ThemedView
- Replace
Rect: From<T: Into<Vec2>>
withRect::from_point
- Add
HideableView::visible
- Add more control to focus changes, including
Event::FocusLost
- Add
EventResult::with_cb_once
- Add
Effect::Dim
(supported on some backends) - Add
LinearLayout::clear
- Add
backends::try_default
- Add
StackView::layer_offset
and deprecateStackView::offset
- Add
Cursive::set_window_title
to change the terminal window title
- Dependencies update:
- Replaced
wasmer_enumset
withenumset
- Replaced
chrono
withtime
for logger
- Replaced
- Removed a bunch of deprecated methods and types:
- All
_id
methods that were replaced with_name
equivalent BoxView
,ViewBox
,SizedView
,Identifiable
,Boxable
,IdView
,Selector::Id
- All
- Added
set_title
to theBackend
trait - Update dependencies:
- crossterm to 0.22.1
- pancurses to 0.17.0
- Fix an issue with focus for Dialog
- Fix
important_area
for ListView - Do not shrink panels under the size required for the title
- Include wheel down event on legacy pancurses systems
- Use non-blocking IO on termion backend
- Fix
Align::bot_right
- Fix delimiter handling in
ListView
- Fix input handling in crossterm backend
- Fix focus issue with SelectView when in popup mode
- Updated internal dependencies:
- enum-map to 2.0
- pulldown-cmark to 0.9
- Implement
Borrow<Cursive>
forCursiveRunnable
- Add methods to turn a CursiveRunnable into a CursiveRunner.
- Fix mouse input with crossterm backend.
- Fix colors in menubar.
- Backends are now initialized when starting the event loop rather than when creating Cursive.
- As a result initialization and runner functions have changed.
ColorStyle::color
is no longer an optional. UseColorType::InheritParent
if needed.- Replaced
()
error types with some custom zero-sized types.
- Add
ProgressBar::set_{min,max,range,counter,label}
for non-chained API. - Derive Clone, Copy, Debug, PartialEq, Hash for more types.
- Add backend initializers using other files than /dev/tty for ncurses and termion.
- Add
CursiveRunner
to handle an event loop. XY<T>
now implementsDefault
forT: Default
.Style
now implementsFromIterator<&Style>
to merge multiple styles.XY::stack_{horizontal,vertical}
are nowmust_use
.SpannedString
now implementsFromIterator<SpannedString>
.view::ScrollBase
is now deprecated in favor of theview::scroll
module.- Add
Finder::call_on_all
andCursive::call_on_all_named
to call the same closure of several views with the same type and name. - Add
SpannedString::remove_spans
to remove spans from a StyledString. - Add
SpannedString::compact
to compact the source to only include span content. - Add
SpannedString::trim(_{start, end})
to remove the unused prefix, suffix or both of the source. - Add
SpannedString::spans(_raw)_attr_mut
to give mutable access to the attribute of the spans. - Add
TextContent::with_content
to give mutable access to theStyledString
of aTextView
. - Add
ColotyType::InheritParent
to carry over the front or back color from the parent. - Add
Effect::Blink
. - Add
Margins::zeros()
. - Add
TextView::set_style
. - Add
SpannedString
-shrinking methods.
ListView
now supports children taller than 1 row.- Added an
autocomplete
example. - Added a
stopwatch
example. SpannedString
iterators are now double-ended and exact-sized.
- Fix scroll module when inner view size is close to available size.
- Fix text alignment for wrapped lines.
- Fix focus change with ScrollView.
- Fix possible crash with the BearLibTerminal backend.
- Dispatch
call_on_*
methods to all screens. - Fix potential issue with
setlocale
in ncurses backend on BSD. - Fix handling of multi-bytes newlines characters.
- Improve documentation for themes.
- Add
Dialog::into_content
. - Add
Callback::from_fn_once
andonce1!
macro to wrap aFnOnce
in aFnMut
. - Add
FixedLayoutView
with manual placement of child views. - Add
OnLayoutView
to overrideView::Layout
- Add
Cursive::{dump, restore}
to save and load the global state. - Add
NamedView::{name, set_name}
to retrieve or replace the given name. - Add
LinearLayout::find_child_with_name
. - Add
ScrollView::on_scroll
callback. - Add
once1!
macro to turn aFnOnce
intoFnMut
. - Implement
Default
for some wrapper views where the child isDefault
.
- More hygienic
wrap_impl!
macro using fully-qualified paths. - Fixed
LinearLayout
giving children incorrect sizes. - More accurate "important area" for
ShadowView
andPaddedView
. - Fix potential panic when calling
TextArea::set_cursor
before its first layout phase. - Disabled views no longer accept input if they are still in focus.
- Split library into a backend-agnostic
cursive-core
and a user-facingcursive
. Cursive::default
now needs thecursive::CursiveExt
trait to be in scope.- Update dependencies:
- crossterm to 0.17.
- enumset to 1.0
- ahash to 0.3
- pulldown-cmark to 0.7
- Add
PaletteColor::HighlightText
AnyCb
now takes a&mut dyn View
rather than a&mut dyn Any
.
- Added
cursive::{default,ncurses,pancurses,termion,crossterm,blt,dummy}
functions. - Add
Cursive::debug_name
- Add
ScreensView
to move some code away from theCursive
root- Reworked global callbacks configuration
- Ctrl-C can be rewired to no longer exit the application
- Add
SelectView::(try_)iter_mut()
Dialog::{test, info}
now acceptStyledString
as input- Add missing functions to Checkbox re: enabled state
- Fix Ctrl-Z binding for ncurses
- Fix potential crash with empty
SelectView
- Add
toml
andmarkdown
features to docs.rs
cursive::event::AnyCb
changed fromBox<...>
to&mut ...
, so users ofView::call_on_any
no longer need to box their closures.- Remove
BoxView::squishable
. - Update crossterm to 0.14.
- Removed
From
implementations forMargins
. UseMargins::lrtb
and the like instead.- Or
Dialog::padding_lrtb
.
- Or
- Renamed multiple types (old names are still re-exported, but deprecated):
BoxView
->ResizedView
ViewBox
->BoxedView
SizedView
->LastSizeView
Identifiable
->Nameable
Boxable
->Resizable
IdView
->NamedView
Selector::Id
->Selector::Name
with_id
->with_name
call_on_id
->call_on_name
find_id
->find_name
focus_id
->focus_name
SelectView::{item, with_all}
now acceptS: Into<StyledString>
for colored labels.- Add
ScrollView::scroll_to_important_area
. - Add
LinearLayout::set_focus_index
. - Add
XY::{sum, product}
. view::scroll
is now a public module.- Add
Cursive::process_events
andCursive::post_events
.- This gives users finer control than
Cursive::step
.
- This gives users finer control than
Layer
now has acolor
option.LinearLayout
can now directly add boxed views without re-boxing.- Add inner getters to
EnableableView
. - Add
PaddedView::get_inner(_mut)
. - Add a bunch of constructors for
Margins
. - Add
Dialog::padding_lrtb
- Add
Dialog::set_padding*
- Add
PaddedView::lrtb
- Changed the default color for
TitleSecondary
from yellow to light blue. - Changed the default color for
Tertiary
from grey to white. - Reduced dependencies (
toml
is now optional, removedhashbrown
). Cursive::default()
now fallbacks do dummy backend if no other is available.
- Fixed
ScrollView::show_scrollbars()
. - Correctly update the offset for
ScrollView
after focus change. - Fixed layout for
BoxView
with some size constraints. - On Windows, do not print unix-specific character during initialization.
- Fix out-of-bounds access for some mouse events in
MenuPopup
- Update
enum-map
from 0.5 to 0.6
- Add
Effect::Strikethrough
(not supported on ncurses) - Add
ListView::remove_child
- Replace
xursive::CbFunc
withBox<FnOnce>
- Add
ScrollView::{inner_size, is_as_{bottom, top, left, right} }
- Add getters for current value in
SliderView
- More fields made public in
cursive::logger
- Add a "puppet" backend for testing and instrumentation
- Performance improvements for the crossterm backend
- Fix a possible panic when a TextView is updated asynchronously while it's being laid out.
- Fixed weird behaviour of
SizeConstraint::Full
withScrollView
.
- Updated
enumset
from 0.3 to 0.4
- Add
Cursive::take_user_data
, replaces the current user data with()
. - Add
SliderView::{get_value, get_max_value}
.
DebugConsole
now has horizontal scrolling enabled.pancurses
backend now correctly recognizes the "Enter" key from the numpad as "Enter".
- Bring back
Cursive::set_fps
for <30Hz refresh rates. - Add
Cursive::backend_name
to get the name of the current backend. - Add a new backend based on the crossterm library.
- Add direct downcast methods to
dyn AnyView
- Add sort methods to
SelectView
- Improved printer performance with styled spans.
- Added manual scrolling methods to
view::scroll::Core
:keep_in_view
,scroll_to
,scroll_to_x
,scroll_to_y
Note: theview::scroll
module is hidden behind an experimental featureunstable_scroll
.
- Improved printer performance (thanks to @chrisvest).
- Fixed
MenuPopup
borders near delimiters.
Cursive::{ncurses, pancurses, termion}
now returnio::Result<Self>
instead of panicking.Cursive::default()
still unwraps.- Also added
Cursive::try_new
for failible backends.
- Also added
- Replaced
set_fps(i32)
withset_autorefresh(bool)
Finder::find_id()
is renamed tocall_on_id()
, and a properfind_id()
was added instead.- Updated the Backend trait for a simpler input system
- Updated to Rust 2018 edition (now requires rustc > 1.31)
Cursive::clear()
now takes&mut self
- Add a logging implementation (
logger::init()
) and aDebugConsole
(cursive::toggle_debug_console()
) - Add user-data to Cursive.
Cursive::set_user_data()
can store some user-defined data structure.Cursive::user_data()
andCursive::with_user_data()
can be used to access the data.
- Add
StackView::remove_layer()
- Add
CircularFocus
view (and bring proper circular focus to dialogs) - Add
HideableView::is_visible()
- Add
type CbSink = Sender<Box<CbFunc>>
as an alias for the return type ofCursive::cb_sink()
- Add
LinearLayout::{insert_child, swap_children, set_weight}
for more in-place modifications. - Add
Printer::{cropped_centered,shrinked_centered}
- Updated termion backend to use direct /dev/tty access for improved performance.
- Enabled raw mode for ncurses and pancurses. Among other improvements, this lets applications receive Ctrl+S and Ctrl+Q events.
- Fixed overflow check for titles in
Dialog
andPanel
- Add
EventTrigger
and updateOnEventView
to use it.- Breaking change: "inner" callbacks for OnEventView now take the event as extra argument.
- Add
Printer::enabled
andEnableableView
to disable whole subtrees. - Add
RadioGroup::on_change
to set a callback on selection change. SelectView
now usesStyledString
to display colored text.- Add
PaddedView
to add padding to any view. - Update dependencies
- Breaking change: crossbeam-channel was updated, and using
send()
now returns aResult
.
- Breaking change: crossbeam-channel was updated, and using
- Fix mouse events on Ubuntu
- Added examples to most utility types (
XY
,Vec2
, ...)
- Add an optional title to
Panel
- Add
immut1!
,immut2!
andimmut3!
macros to wrap aFnMut
inFn
- SelectView: autojump is now opt-in (jump to an element after a letter is pressed)
- Fix possible crash with
ListView
andSelectView
in very small spaces - Fix termion backend compilation on non-unix platforms
- Add
Cursive::on_event
to send simulated events. - Add
EventResult::and
to combine callbacks. - Allow custom color in
ProgressBar
.
- LinearLayout:
- Better geometry computation with constrained size
- Fixed cache invalidation
- Fix possible panic when removing children
- ScrollView:
- Fix possible panic with full-height scrollbar
- Fix possible panic with empty content
- Fix cache
- Fix menubar focus after action
- Fix Readme and examples with
Cursive::default()
- Cursive now supports third-party backends
- Add generic
ScrollView
wrapper. Removes internal scrolling behaviour fromTextView
. - Callbacks sent through
Cursive::cb_sink()
are now processed instantly, without the need forset_fps
. - Make backend a dynamic choice
- User must select a backend in
Cursive::new
- 3rd party libraries do not need to play with backend features anymore
- User must select a backend in
- Move from
chan
andchan-signals
tocrossbeam-channel
andsignal-hook
- Batch-process events for higher performance
- Add
StackView::find_layer_from_id
- Add
SelectView::insert_item
- Add
TextArea::{enable, disable}
- Reworked
AnyView
SelectView
: Fix mouse events- Return callbacks from manual control methods
SelectView::{set_selection, select_up, select_down, remove_item}
EditView::{set_content, insert, remove}
- Add
rect::Rect
- Add
HideableView
- Replaced
Cursive::new()
withCursive::default()
- Renamed
Vec4
toMargins
Callbacks
cannot be created from functions that return a value- The returned value used to be completely ignored
AnyView
does not extendView
anymore (instead,View
extendsAnyView
)- If you were using
AnyView
before, you probably need to replace it withView
- If you were using
- Scrolling is now added to a view with
.scrollable()
cb_sink
is now acrossbeam_channel::Sender
instead ofchan::Sender
SelectView::selection
now returns anOption<Rc<T>>
instead of justRc<T>
. It will returnNone
if theSelectView
is empty.
- Add
Cursive::clear_global_callbacks
- Fix non-ASCII input with pancurses backend
- Fix
StackView::move_layer
- Fix layout computation for
SelectView
- Remove unused
maplit
dependency for termion and blt backends
- Style (breaking change):
- Added support for bold/italic/underlined text
- Added
StyledString
for markup text - Refactored line-break module
- Colors (breaking change):
- Added ColorStyle and PaletteColor for more flexible colored text
- Buttons:
- Added
Dialog::buttons
to iterate on buttons - Added
Button::set_label
andButton::label
- Added
- TextView:
- Added TextContent, a way to separate model and view for TextView
- Added manual scrolling methods
- Allow multiple global callbacks per event
- Allow buttons and delimiters in top-level menubar
- StackView:
- Added
StackView::move_layer
to re-order layers StackView::pop_layer
now returns the pop'ed view- Added
StackView::reposition_layer
to move a layer around
- Added
- Dialog: added
Dialog::focus(&self)
- SelectView: added
SelectView::selected
Cursive::cb_sink
now acceptsFnOnce
(previouslyFn
only)
- Fix a bug in
TextArea::set_content
- Fix
Color::from_256colors
for grayscale colors - Fix resize detection on windows
- Fix possible panic with weird input on pancurses
- Fix possible panic in ListView layout
- Add per-distributions instructions to install ncurses
- Improved comments in examples
- Improve doc for
Cursive::find_id
- Improve doc for
Identifiable::with_id
- Include Changelog