()
| 18 | |
| 19 | impl SkillListDialog { |
| 20 | pub fn new() -> Self { |
| 21 | let mut state = ListState::default(); |
| 22 | state.select(Some(0)); |
| 23 | Self { |
| 24 | skills: Vec::new(), |
| 25 | filtered: Vec::new(), |
| 26 | query: String::new(), |
| 27 | state, |
| 28 | open: false, |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | pub fn set_skills(&mut self, mut skills: Vec<String>) { |
| 33 | skills.sort_by(|a, b| a.to_ascii_lowercase().cmp(&b.to_ascii_lowercase())); |