diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7a0657c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Florian Dehau + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README b/README deleted file mode 100644 index 8b13789..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ - diff --git a/README.md b/README.md new file mode 100644 index 0000000..dab758b --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# tui-rs + +Demo cast under Linux Termite with Inconsolata font 12pt + +`tui-rs` is a [Rust](https://www.rust-lang.org) library to build rich terminal +user interfaces and dashboards. It is heavily inspired by the `Javascript` +library [blessed-contrib](https://github.com/yaronn/blessed-contrib) and the +`Go` library [termui](https://github.com/gizak/termui). + +The library itself supports two different backends to draw to the terminal. You +can either choose from: + + - [termion](https://github.com/ticki/termion) + - [rustbox](https://github.com/gchp/rustbox) + + +## Cargo.toml + +```toml +[dependencies] +tui: "0.1" +``` + +## License + +[MIT](LICENSE) + +## Author + +Florian Dehau diff --git a/docs/demo.gif b/docs/demo.gif new file mode 100644 index 0000000..290f8f8 Binary files /dev/null and b/docs/demo.gif differ diff --git a/examples/demo.rs b/examples/demo.rs index 5dc0a41..ec32f61 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -246,7 +246,7 @@ fn main() { let tx = tx.clone(); loop { tx.send(Event::Tick).unwrap(); - thread::sleep(time::Duration::from_millis(500)); + thread::sleep(time::Duration::from_millis(200)); } }); @@ -452,7 +452,6 @@ fn draw_main(t: &mut Terminal, app: &App, area: &Rect) { .borders(border::ALL) .title("List")) .items(&app.items2) - .style(Style::default().fg(Color::Gray)) .render(t, &chunks[1]); }); BarChart::default() @@ -503,9 +502,11 @@ fn draw_main(t: &mut Terminal, app: &App, area: &Rect) { } }); Paragraph::default() - .block(Block::default().borders(border::ALL).title("Footer")) + .block(Block::default() + .borders(border::ALL) + .title("Footer") + .title_style(Style::default().fg(Color::Magenta).modifier(Modifier::Bold))) .wrap(true) - .style(Style::default().fg(app.colors[app.color_index])) .text("This is a paragraph with several lines.\nYou can change the color.\nUse \ \\{fg=[color];bg=[color];mod=[modifier] [text]} to highlight the text with a color. For example, {fg=red \ u}{fg=green n}{fg=yellow d}{fg=magenta e}{fg=cyan r} {fg=gray t}{fg=light_gray h}{fg=light_red \