Skip to content

Commit

Permalink
move line and tui renderers into render module
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 10, 2020
1 parent 7435f35 commit 31358a7
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* `tree::Value``progress::Value`
* `tree::Progress``Progress`
* Remove `Hash` implementation for all public types except for `tree::Key`
* Move `tui` and `line` renderers into the `render` module


## v7.1.1
Expand Down
7 changes: 4 additions & 3 deletions examples/shared/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use futures_util::{future::FutureExt, stream::StreamExt};
use prodash::{
line, tui,
tui::Line,
tui::{ticker, Event, Interrupt},
render::{
line,
tui::{self, ticker, Event, Interrupt, Line},
},
Tree,
};
use rand::{seq::SliceRandom, thread_rng, Rng};
Expand Down
6 changes: 1 addition & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ Run it with `cargo run --example dashboard` and see what else it can do by check
pub mod tree;
pub use tree::{Options as TreeOptions, Root as Tree};

#[cfg(feature = "tui-renderer")]
pub mod tui;

#[cfg(feature = "line-renderer")]
pub mod line;
pub mod render;

#[cfg(feature = "log-renderer")]
pub use log::info;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/line/engine.rs → src/render/line/engine.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{line::draw, tree};
use crate::{render::line::draw, tree};
use std::{
io,
ops::RangeInclusive,
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions src/render/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[cfg(feature = "tui-renderer")]
pub mod tui;

#[cfg(feature = "line-renderer")]
pub mod line;
6 changes: 3 additions & 3 deletions src/tui/draw/all.rs → src/render/tui/draw/all.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use crate::{
progress::Value,
tree,
tree::{Key, Message},
tui::{
render::tui::{
draw,
utils::{block_width, rect},
InterruptDrawInfo, Line,
},
tree,
tree::{Key, Message},
};
use std::time::Duration;
use tui::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::tui::{
use crate::render::tui::{
utils::{block_width, draw_text_with_ellipsis_nowrap, rect},
Line,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
render::tui::utils::{block_width, draw_text_with_ellipsis_nowrap, rect, sanitize_offset, VERTICAL_LINE},
time::{format_time_for_messages, DATE_TIME_HMS},
tree::{Message, MessageLevel},
tui::utils::{block_width, draw_text_with_ellipsis_nowrap, rect, sanitize_offset, VERTICAL_LINE},
};
use std::time::SystemTime;
use tui::{
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/tui/draw/progress.rs → src/render/tui/draw/progress.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use crate::{
progress::{self, Step, Value},
time::format_now_datetime_seconds,
tree::{self, Key},
tui::{
render::tui::{
draw::State,
utils::{
block_width, draw_text_nowrap_fn, draw_text_with_ellipsis_nowrap, rect, sanitize_offset,
GraphemeCountWriter, VERTICAL_LINE,
},
InterruptDrawInfo,
},
time::format_now_datetime_seconds,
tree::{self, Key},
unit, Progress,
};
use humantime::format_duration;
Expand Down
2 changes: 1 addition & 1 deletion src/tui/engine.rs → src/render/tui/engine.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{tree, tree::Root, tui::draw, tui::ticker};
use crate::{render::tui::draw, render::tui::ticker, tree, tree::Root};

use futures_util::StreamExt;
use std::{
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 31358a7

Please sign in to comment.