From 682349c03ea01b285be070f265604502ae050906 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Sun, 15 Dec 2019 15:52:11 -0800 Subject: [PATCH] update block example; add BorderType to exposed widgets API --- examples/block.rs | 6 +++--- src/widgets/mod.rs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/block.rs b/examples/block.rs index 94000f9..c5a702c 100644 --- a/examples/block.rs +++ b/examples/block.rs @@ -9,7 +9,7 @@ use termion::screen::AlternateScreen; use tui::backend::TermionBackend; use tui::layout::{Constraint, Direction, Layout}; use tui::style::{Color, Modifier, Style}; -use tui::widgets::{Block, Borders, Widget}; +use tui::widgets::{Block, BorderType, Borders, Widget}; use tui::Terminal; use crate::util::event::{Event, Events}; @@ -35,7 +35,7 @@ fn main() -> Result<(), failure::Error> { Block::default() .borders(Borders::ALL) .title("Main block with round corners") - .rounded() + .set_border_type(BorderType::Rounded) .render(&mut f, size); let chunks = Layout::default() .direction(Direction::Vertical) @@ -75,7 +75,7 @@ fn main() -> Result<(), failure::Error> { .title("With styled and double borders") .border_style(Style::default().fg(Color::Cyan)) .borders(Borders::LEFT | Borders::RIGHT) - .double_border() + .set_border_type(BorderType::Double) .render(&mut f, chunks[1]); } })?; diff --git a/src/widgets/mod.rs b/src/widgets/mod.rs index 8752691..989083c 100644 --- a/src/widgets/mod.rs +++ b/src/widgets/mod.rs @@ -15,6 +15,7 @@ mod tabs; pub use self::barchart::BarChart; pub use self::block::Block; +pub use self::block::BorderType; pub use self::chart::{Axis, Chart, Dataset, Marker}; pub use self::gauge::Gauge; pub use self::list::{List, SelectableList};