summaryrefslogtreecommitdiffstats
path: root/src/interactive/widgets/mark.rs
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-06-06 16:17:59 +0530
committerSebastian Thiel <sthiel@thoughtworks.com>2019-06-06 16:17:59 +0530
commitb79b1aee4ebe97034da0804f5d1dae2bfedd1210 (patch)
tree16843439ec2931a8b50f1c6e6ed9f8e0ee11d348 /src/interactive/widgets/mark.rs
parentf54a5aa7aef7f5a29131db485154607bedc4da23 (diff)
The first display of paths to be deleted!
Still no way to show that one is contained in others... probably not needed right now... .
Diffstat (limited to 'src/interactive/widgets/mark.rs')
-rw-r--r--src/interactive/widgets/mark.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/interactive/widgets/mark.rs b/src/interactive/widgets/mark.rs
index 97f0abd..5c09f40 100644
--- a/src/interactive/widgets/mark.rs
+++ b/src/interactive/widgets/mark.rs
@@ -2,7 +2,10 @@ use crate::interactive::EntryMarkMap;
use dua::traverse::TreeIndex;
use itertools::Itertools;
use std::borrow::Borrow;
-use tui::{buffer::Buffer, layout::Rect, style::Style, widgets::Block, widgets::Borders};
+use tui::{
+ buffer::Buffer, layout::Rect, style::Color, style::Style, widgets::Block, widgets::Borders,
+ widgets::Text,
+};
use tui_react::{List, ListProps};
#[derive(Default)]
@@ -41,10 +44,21 @@ impl MarkPane {
.map(|(pos, _)| pos)
});
+ let entries = marked.iter().map(|(_, v)| {
+ let name = Text::Styled(
+ v.path.to_string_lossy(),
+ Style {
+ fg: Color::LightRed,
+ ..Style::default()
+ },
+ );
+ vec![name]
+ });
+
let props = ListProps {
block: Some(block),
entry_in_view,
};
- self.list.render(props, vec![], area, buf)
+ self.list.render(props, entries, area, buf)
}
}