Commit Graph

454 Commits (8543523f18e805fc2289e09e24e71c1d51fee3a8)
 

Author SHA1 Message Date
Florian Dehau 963f11a6b1 Release v0.9.4 4 years ago
Florian Dehau a7761fe55d fix(buffer): ignore zero-width graphemes 4 years ago
Florian Dehau 10cf9305f1 Release v0.9.3 4 years ago
Clement Tsang b72ced4511
fix(widgets/chart): remove overflow when dataset if empty (#274)
* docs: Fix missing code block fence
* use slice::windows to deal with underflow issue
* add test for empty dataset and lines
4 years ago
Florian Dehau eb47c778db Release v0.9.2 4 years ago
Darrien Glasser 359b7feb8c
fix(widgets/canvas): Add bounds check when drawing line high/low (#283)
* Add bounds check when drawing line high/low
* Add test to ensure codepath doesn't break
4 years ago
chrunchyjesus 6ffdede95a
chore: add documentation field in Cargo.toml (#277) 4 years ago
24seconds 4db0250b95
Add rust-sadari-cli in `Apps using tui` section (#278) 4 years ago
SoptikHa2 69780bbbec Add desed to list of apps using tui?
Desed is new application that is using tui-rs. It's debugger for sed with all the things like stepping, setting breakpoints and examining runtime state.
4 years ago
Florian Dehau fda89d6859 Release v0.9.1 4 years ago
Florian Dehau 5d99b4af00 docs: improve widgets documentation 4 years ago
Florian Dehau da4d4e1672 test: assert items are correctly truncated in the `List` widget 4 years ago
Björn Steinbrink 8f9aa276e8 fix(widgets/list): fix line length calculation for selectable lists
The code that outputs the list elements uses the full inner width of its
block, without taking the width of the highlight symbol into
consideration. This allows the elements to overflow the box and draw
over the block's border. To fix that, we need to reduce the target width
for the list elements.
4 years ago
Florian Dehau 8debb0d338 Release v0.9.0 4 years ago
Florian Dehau bc2a512101 feat: add missing `Clone` and `Copy` on types 4 years ago
Florian Dehau 4f728d363f fix(widgets/list): stop highlighting blank placeholders 4 years ago
Florian Dehau e81af75427 fix(examples): improve input handling in crossterm demo
* avoid stacking events
* ensure tick events are sent at the given tick rate (and not everytime a key is pressed).
4 years ago
Florian Dehau 8387b32bb8 chore: update changelog 4 years ago
Florian Dehau 2fccee740b chore: add command to README to run demos without all unicode symbols 4 years ago
Florian Dehau c98002eb76 feat: add an option to run the examples without all unicode symbols 4 years ago
Florian Dehau 584e1b0500 refactor(widgets/canvas): allow canvas to render with a simple dot character instead of braille patterns
This change allows developers to gracefully degrade the output if the targeted
terminal does not support the full range of unicode symbols.
4 years ago
Florian Dehau cee65ed283 feat: allow BarChart and Sparkline to use a more portable set of symbols
Add `BarChart::bar_set` and `Sparkline::bar_set` methods to customize
the set of symbols used to display the data. The new set should give
a better looking output on terminal that do not support a wide range
of unicode symbols.
4 years ago
Stephan Dilly 8104b17ee6
chore: bump crossterm to 0.17
this fixes #250 because crossterm `0.17.3` has a fix for the resize/size issue

Co-Authored-By: Florian Dehau <work@fdehau.com>

Co-authored-by: Florian Dehau <work@fdehau.com>
4 years ago
Stephan Dilly 7676d3c7df add clear widget and popup example utilizing it 4 years ago
orhun 3e6211e0a3 doc: Add kmon to 'apps using tui' in README 4 years ago
Stephan Dilly 05c472b741 add program using tui-rs 4 years ago
Florian Dehau 867ba1fd8c chore: update changelog 4 years ago
Stephan Dilly fd48719040 fix some typos 4 years ago
Loïc Girault d987225ac8 Add thick lines and line::Set struct
Add a new style of line and use a struct to avoid duplication of
matching
4 years ago
Florian Dehau 503bdeeadb chore: bump itertools to 0.9 4 years ago
Florian Dehau d3f1669234 chore(Makefile): add lint to stable and beta rules 4 years ago
Florian Dehau 3f62ce9c19 chore: remove unecessary dependencies
* Remove log, stderrlog, structopt
* Add argh
4 years ago
Florian Dehau 278c153d31 style: remove clippy warnings 4 years ago
Florian Dehau ae677099d6 feat(widgets/table): allow one row to be selected 4 years ago
Florian Dehau 140db9b2e2 refactor(canvas): update shape drawing strategy
* Update the `Shape` trait. Instead of returning an iterator of point, all
shapes are now aware of the surface they will be drawn to through a `Painter`.
In order to draw themselves, they paint points of the "braille grid".
* Rewrite how lines are drawn using a common line drawing algorithm (Bresenham).
4 years ago
Florian Dehau a6b35031ae chore: use master branch instead of latest release for crossterm
This will prevent [this](https://github.com/crossterm-rs/crossterm/pull/383)
descriptor leak bug when people use the crossterm backend with the current
master.
4 years ago
hatoo 004cf2687a Add `oha` to the "apps using tui" list 4 years ago
Clement Tsang cf8db5ea23 Add bottom to the "apps using tui" list 4 years ago
Vadim Chekan 1683e8d609
Clean redundant generics params in Table (#234)
* Clean redundant generics params in Table

It is possible to use associated types the same way as generics parameters. In fact associated types are nothing more than better organized generics params. For example, there is no need to introduce another param to constraint iterator item to be Display, you can just say `where I::Iterator, I::Item: Display`. This allows to drop type params for Table from 5 to 2.
4 years ago
Benjamin Vaisvil f372e034e8 added to Apps using tui 4 years ago
Florian Dehau 8c3db49fba chore: bump crossterm to 0.16 4 years ago
Florian Dehau 02b1aac0b0 chore: remove outdated badges 4 years ago
Florian Dehau 6cb57f5d2a feat: add stateful widgets
Most widgets can be drawn directly based on the input parameters. However, some
features may require some kind of associated state to be implemented.

For example, the `List` widget can highlight the item currently selected. This
can be translated in an offset, which is the number of elements to skip in
order to have the selected item within the viewport currently allocated to this
widget. The widget can therefore only provide the following behavior: whenever
the selected item is out of the viewport scroll to a predefined position (make
the selected item the last viewable item or the one in the middle).
Nonetheless, if the widget has access to the last computed offset then it can
implement a natural scrolling experience where the last offset is reused until
the selected item is out of the viewport.

To allow such behavior within the widgets, this commit introduces the following
changes:
- Add a `StatefulWidget` trait with an associated `State` type. Widgets that
can take advantage of having a "memory" between two draw calls needs to
implement this trait.
- Add a `render_stateful_widget` method on `Frame` where the associated
state is given as a parameter.

The chosen approach is thus to let the developers manage their widgets' states
themselves as they are already responsible for the lifecycle of the wigets
(given that the crate exposes an immediate mode api).

The following changes were also introduced:

- `Widget::render` has been deleted. Developers should use `Frame::render_widget`
instead.
- `Widget::background` has been deleted. Developers should use `Buffer::set_background`
instead.
- `SelectableList` has been deleted. Developers can directly use `List` where
`SelectableList` features have been back-ported.
4 years ago
Florian Dehau 67dd1ac608 fix: remove array_into_iter warnings 4 years ago
Malte Tammena 808a5c9ffd Mark Style::* functions `const` 4 years ago
Florian Dehau d16db5ed90 style: fix clippy warnings 4 years ago
Florian Dehau 6e24f9d47b style: run cargo fmt 4 years ago
tarkah 92ab09496a add ytop to apps using 4 years ago
Florian Dehau 28017f97ea feat(widgets/chart): add more control on the visibility of the legend 4 years ago
Florian Dehau ea43413507 fix: remove clippy warnings 4 years ago