()
| 25 | |
| 26 | impl ThemeListDialog { |
| 27 | pub fn new() -> Self { |
| 28 | let mut state = ListState::default(); |
| 29 | state.select(Some(0)); |
| 30 | Self { |
| 31 | options: Vec::new(), |
| 32 | filtered: Vec::new(), |
| 33 | query: String::new(), |
| 34 | initial_theme: "opencode@dark".to_string(), |
| 35 | state, |
| 36 | open: false, |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | pub fn set_options(&mut self, mut options: Vec<ThemeOption>) { |
| 41 | options.sort_by(|a, b| a.name.to_lowercase().cmp(&b.name.to_lowercase())); |