Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and simplify demo example #56

Merged
merged 2 commits into from
Feb 4, 2024
Merged

Update and simplify demo example #56

merged 2 commits into from
Feb 4, 2024

Conversation

joshka
Copy link
Contributor

@joshka joshka commented Feb 4, 2024

Updated the demo example to use features from the latest version of the
ratatui crate and simplified the application model significantly. Note
that the main crate is still compatible with ratatui version 0.25.0,
but the demo example uses features from 0.26.0.

Moved the optional dependencies on termion and crossterm to the
dev-dependencies section of the Cargo.toml file, and made them
mutually exclusive in the demo example. Moved the backend specific code
into seperate modules.

To run the demo, use either of the following commands:

cargo run --example demo --features crossterm
cargo run --example demo --features termion

Added a bacon config file to make it easy to check that the demo
compiles with the crossterm and termion features enabled.


Note: includes changes from #55, which is a breaking change that should probably be merged separately this.

These enums are small and simple enough to be `Copy`. This change
simplifies calling code to not have to use `&` when passing or
comparing these enums.

See https://doc.rust-lang.org/std/marker/trait.Copy.html#when-should-my-type-be-copy
for justification.

BREAKING CHANGE: `TuiWidgetEvent::transition()` method now takes a
`TuiWidgetEvent` by value instead of by reference.
Updated the demo example to use features from the latest version of the
`ratatui` crate and simplified the application model significantly. Note
that the main crate is still compatible with `ratatui` version `0.25.0`,
but the demo example uses features from `0.26.0`.

Moved the optional dependencies on `termion` and `crossterm` to the
`dev-dependencies` section of the `Cargo.toml` file, and made them
mutually exclusive in the demo example. Moved the backend specific code
into seperate modules.

To run the demo, use either of the following commands:

```shell
cargo run --example demo --features crossterm
cargo run --example demo --features termion
```

Added a bacon config file to make it easy to check that the demo
compiles with the `crossterm` and `termion` features enabled.
@joshka joshka changed the title dev Update and simplify demo example Feb 4, 2024
@joshka
Copy link
Contributor Author

joshka commented Feb 4, 2024

Termion

image

Crossterm

image

@gin66 gin66 merged commit 241f5f9 into gin66:master Feb 4, 2024
1 check passed
@joshka joshka deleted the dev branch April 1, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants