| 181 | } |
| 182 | |
| 183 | fn build_rows(&mut self) { |
| 184 | self.rows.clear(); |
| 185 | self.selectable_row_indices.clear(); |
| 186 | |
| 187 | // Providers group |
| 188 | self.rows.push(DisplayRow::GroupHeader("PROVIDERS".into())); |
| 189 | for i in 0..self.templates.len() { |
| 190 | let row_idx = self.rows.len(); |
| 191 | self.selectable_row_indices.push(row_idx); |
| 192 | self.rows.push(DisplayRow::Provider(i)); |
| 193 | } |
| 194 | |
| 195 | // Custom group |
| 196 | self.rows.push(DisplayRow::GroupHeader("CUSTOM".into())); |
| 197 | let row_idx = self.rows.len(); |
| 198 | self.selectable_row_indices.push(row_idx); |
| 199 | self.rows.push(DisplayRow::Custom); |
| 200 | } |
| 201 | |
| 202 | fn move_up(&mut self) { |
| 203 | if self.selectable_row_indices.is_empty() { |