Add values, complete the board edges and nodes wise
This commit is contained in:
		
							parent
							
								
									92b0d5cb01
								
							
						
					
					
						commit
						da1c4b7f3f
					
				| @ -8,6 +8,7 @@ use rfd::FileDialog; | ||||
| use board_builder::{ Board, CoordTransformer, read_board_from_file, write_board_to_file }; | ||||
| 
 | ||||
| use std::path::Path; | ||||
| use std::collections::HashSet; | ||||
| use std::rc::Rc; | ||||
| use std::cell::RefCell; | ||||
| 
 | ||||
| @ -303,7 +304,13 @@ impl EditLabelsDialog { | ||||
|                 if self.add_key_dialog.open { | ||||
|                     if let StringDialogResponse::Accepted(key) = | ||||
|                         self.add_key_dialog.ui(ui, "Add Key") { | ||||
|                             board.labels.insert(key, Vec::new()); | ||||
|                             board.labels.insert(key, HashSet::new()); | ||||
|                         } | ||||
|                 } | ||||
|                 if self.add_value_dialog.open && selected_label_key != &String::new() { | ||||
|                     if let StringDialogResponse::Accepted(value) = | ||||
|                         self.add_value_dialog.ui(ui, "Add Value") { | ||||
|                             board.labels.get_mut(selected_label_key).unwrap().insert(value); | ||||
|                         } | ||||
|                     } | ||||
|             }); | ||||
|  | ||||
| @ -14,7 +14,7 @@ pub struct Node { | ||||
| #[derive(Serialize, Deserialize, Debug, Default)] | ||||
| #[serde(default)] | ||||
| pub struct Board { | ||||
|     pub labels: HashMap<String, Vec<String>>, | ||||
|     pub labels: HashMap<String, HashSet<String>>, | ||||
|     pub nodes: HashMap<usize, Node>, | ||||
| } | ||||
| impl Board { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user