|
|
@@ -1,13 +1,21 @@
|
|
|
+// first one selected
|
|
|
+
|
|
|
// list on left
|
|
|
// info page on right
|
|
|
// when selected takes up full page
|
|
|
+// identifier is random string
|
|
|
+//
|
|
|
+// event handler for the list
|
|
|
+// when the list is selected
|
|
|
+// updates a hashmap that keep track of selected??
|
|
|
+
|
|
|
use crate::app::App;
|
|
|
use tui::{
|
|
|
backend::Backend,
|
|
|
layout::{Constraint, Direction, Layout},
|
|
|
style::{Color, Modifier, Style},
|
|
|
text::Spans,
|
|
|
- widgets::{Block, List, ListItem, Paragraph},
|
|
|
+ widgets::{Block, Borders, List, ListItem, Paragraph},
|
|
|
Frame,
|
|
|
};
|
|
|
|
|
|
@@ -31,8 +39,8 @@ pub fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
|
|
|
|
|
|
let nodes = List::new(nodes)
|
|
|
.block(Block::default())
|
|
|
- .highlight_style(Style::default().bg(Color::Black).add_modifier(Modifier::BOLD))
|
|
|
- .highlight_symbol(">> ");
|
|
|
+ .highlight_style(Style::default().bg(Color::Black).add_modifier(Modifier::BOLD));
|
|
|
+ //.highlight_symbol(">> ");
|
|
|
|
|
|
f.render_stateful_widget(nodes, slice[0], &mut app.node_list.state);
|
|
|
|
|
|
@@ -41,10 +49,30 @@ pub fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
|
|
|
info_vec.push(Spans::from(val.to_string()))
|
|
|
}
|
|
|
|
|
|
- let graph = Paragraph::new(info_vec)
|
|
|
+ let info: Vec<ListItem> = app
|
|
|
+ .node_list
|
|
|
+ .nodes
|
|
|
+ .values()
|
|
|
+ //.iter()
|
|
|
+ .map(|i| {
|
|
|
+ let line2 = Spans::from(i.to_string());
|
|
|
+ ListItem::new(vec![line2]).style(Style::default())
|
|
|
+ })
|
|
|
+ .collect();
|
|
|
+
|
|
|
+ let graph = Paragraph::new(info_vec).block(Block::default()).style(Style::default());
|
|
|
+
|
|
|
+ let info = List::new(info)
|
|
|
.block(Block::default())
|
|
|
- .style(Style::default());
|
|
|
+ .highlight_style(Style::default().bg(Color::Black).add_modifier(Modifier::BOLD))
|
|
|
+ .highlight_symbol(">> ");
|
|
|
+
|
|
|
+ //if app.show_popup {
|
|
|
+ // let block = Block::default().title("Popup").borders(Borders::ALL);
|
|
|
+ // f.render_widget(block, slice[1]);
|
|
|
+ //}
|
|
|
|
|
|
// TODO: make this a stateful widget that changes with scroll
|
|
|
f.render_widget(graph, slice[1]);
|
|
|
+ //f.render_stateful_widget(info, slice[1], &mut app.node_list.state);
|
|
|
}
|