Commit Graph

53 Commits (7870793b4b4b8e9ee4c0a70d51562cd4fee94f06)

Author SHA1 Message Date
Florian Dehau 7870793b4b Release v0.16.0 3 years ago
Florian Dehau 914d54e672 chore: bump crossterm to 0.20 3 years ago
jmrgibson a5f7019b2a
doc: fix minor grammatical errors (#489)
A missing "and" after "an" (which I do all the time) and some tense clarification.
3 years ago
Florian Dehau 90a6a8f2d6 Release v0.15.0 3 years ago
Simas Toleikis 8832281dcf Update crossterm to 0.19. 3 years ago
Florian Dehau 853f3d9200 feat(terminal): add a read-only view of the terminal state after the draw call 3 years ago
Florian Dehau f09863faa0 Release v0.14.0 3 years ago
Florian Dehau 8543523f18 Release v0.13.0 4 years ago
Sebastian Thiel 25ff2e5e61 upgrade crossterm to v0.18
It reduces the amount of dependencies, among other improvements.
4 years ago
Florian Dehau 51b691e7ac Release v0.12.0 4 years ago
Florian Dehau 57862eeda6 Release v0.11.0 4 years ago
Florian Dehau 641f391137 feat(terminal): add unstable api to use a fixed viewport
There was now way to avoid the autoresize behavior of `Terminal`. While it was fine for most users,
it made the testing experience painful as it was impossible to avoid the calls to `Backend::size()`.
Indeed they trigger the following error: "Inappropriate ioctl for device" since we are not running
the tests in a real terminal (at least in the CI).

This commit introduces a new api to create a `Terminal` with a fixed viewport.
4 years ago
Florian Dehau 6504930888 Release v0.10.0 4 years ago
Florian Dehau 88c4b191fb feat(text): add new text primitives 4 years ago
Alexander Batischev 8c2ee0ed85
feat(terminal): Add after-draw() cursor control to Frame (#91) (#309) 4 years ago
Florian Dehau 5a590bca74 chore: enable clippy on all targets and all features
- Remove deny warnings in lib.rs. This allows easier iteration when developing
new features. The warnings will make the CI fails anyway on the clippy CI
stage.
- Run clippy on all targets (including tests and examples) and all features.
- Fail CI on clippy warnings.
4 years ago
Florian Dehau 5d99b4af00 docs: improve widgets documentation 4 years ago
Stephan Dilly fd48719040 fix some typos 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 8293cef703 Release v0.8.0 5 years ago
Florian Dehau e0083fb8de chore: make the onboarding easier for Windows users. 5 years ago
Florian Dehau 3abafc307c Release v0.7.0 5 years ago
TheZoq2 bb28d02277 Update docs to point encourage installing 0.6 5 years ago
Florian Dehau 42731da546 Enable build failure on compilation warnings 5 years ago
Florian Dehau 4436110c44 Improve onboarding in documentation 5 years ago
Sven-Hendrik Haase 144bfb71cf Upgrade to 2018 edition 5 years ago
Karoline Pauls 090975481b Update tests and docs to take size from the Frame 6 years ago
Florian Dehau 4c46ef69e9 Release v0.3.0 6 years ago
Florian Dehau 5d52fd2486 refactor: remove custom termion backends 6 years ago
Florian Dehau 4ae9850e13 fix: replace links to assets 6 years ago
Florian Dehau 3d63f9607f doc: update main documentation 6 years ago
Florian Dehau 13e194cd26 refactor: update widgets
* all widgets use the consumable builder pattern
* `draw` on terminal expect a closure that take a frame as only arg
6 years ago
Florian Dehau d6016788ef refactor: clippy + rustfmt 6 years ago
Florian Dehau ad602a54bf refactor(widgets): replace text rendering in Paragraph
* remove custom markup language
* add Text container for both raw and styled strings
6 years ago
Florian Dehau 7181970a32 feat: split layout from rendering
* remove layout logic from Terminal
* replace Group with Layout
* add Frame intermediate object
6 years ago
Robin Nehls 3f8a9079ee [widgets] implement text alignment for paragraph widget 6 years ago
Florian Dehau 36a5eb2110 Format code 6 years ago
Florian Dehau 4b53acab14 [doc] Fix layout example in documentation 6 years ago
Florian Dehau 7d273b576d Bump version 7 years ago
Florian Dehau c3c5109c5a [src] Fix build and tests 7 years ago
Florian Dehau 151d7e8a1c [src] Update dependencies
* Update all dependencies to their latest versions
* Change border to Borders to match v1.0 of bitflags
7 years ago
Florian Dehau 8907ab90a1 [doc] Move "Get started" from README to src/lib.rs 7 years ago
Florian Dehau 1f285fbac0 [src] Run cargo fmt 7 years ago
Florian Dehau feefa5d54f Convert backends to conditionnal features for compilation 8 years ago
Florian Dehau b19c014889 Fix layout cache on nightly 8 years ago
Florian Dehau 9bc61551e2 Refactor Terminal to be able to support multiple backends
* Add Rustbox as an other possible backend
8 years ago
Florian Dehau a5b632aeb0 Cleanup API 8 years ago
Florian Dehau cd919e69f5 Fix some display errors 8 years ago
Florian Dehau 07ff2b08eb Improve Chart Widget, safer buffer and unicode width 8 years ago
Florian Dehau fde0ba95dd Remove cache system and add unicode segmentation 8 years ago