浏览代码

map: cleanup

lunar-mining 4 年之前
父节点
当前提交
f33b6ab8ee
共有 2 个文件被更改,包括 0 次插入27 次删除
  1. 0 1
      bin/map/src/main.rs
  2. 0 26
      bin/map/src/ui.rs

+ 0 - 1
bin/map/src/main.rs

@@ -59,7 +59,6 @@ fn run_app<B: Backend>(
                 }
                 }
                 Key::Char('j') => app.node_list.next(),
                 Key::Char('j') => app.node_list.next(),
                 Key::Char('k') => app.node_list.previous(),
                 Key::Char('k') => app.node_list.previous(),
-                //Key::Char('\n') => app.show_popup = !app.show_popup,
                 _ => (),
                 _ => (),
             }
             }
         }
         }

+ 0 - 26
bin/map/src/ui.rs

@@ -43,13 +43,6 @@ pub fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
 
 
     f.render_stateful_widget(nodes, slice[0], &mut app.node_list.state);
     f.render_stateful_widget(nodes, slice[0], &mut app.node_list.state);
 
 
-    let mut info_vec = Vec::new();
-    for val in app.node_list.nodes.values() {
-        info_vec.push(Spans::from(val.to_string()))
-    }
-
-    let graph = Paragraph::new(info_vec).block(Block::default()).style(Style::default());
-
     let node_info: Vec<ListItem> = app
     let node_info: Vec<ListItem> = app
         .node_list
         .node_list
         .node_info
         .node_info
@@ -61,29 +54,10 @@ pub fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
         })
         })
         .collect();
         .collect();
 
 
-
-    //let
-    //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 node_info = List::new(node_info)
     let node_info = List::new(node_info)
         .block(Block::default())
         .block(Block::default())
         .highlight_style(Style::default().bg(Color::Blue).add_modifier(Modifier::BOLD));
         .highlight_style(Style::default().bg(Color::Blue).add_modifier(Modifier::BOLD));
 
 
-    //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
     // TODO: make this a stateful widget that changes with scroll
-    //f.render_widget(graph, slice[1]);
     f.render_stateful_widget(node_info, slice[1], &mut app.node_list.state);
     f.render_stateful_widget(node_info, slice[1], &mut app.node_list.state);
 }
 }