| ... | ... | @@ -203,11 +203,11 @@ impl State { |
| 203 | 203 | section: Option<u32>, |
| 204 | 204 | ) { |
| 205 | 205 | let mut all = library.themes().all(); |
| 206 | | // A retired built-in worn here is listed while it is. |
| 206 | // A retired built-in worn here is listed with the others while it is. |
| 207 | 207 | if let Some(wearing) = &wearing |
| 208 | 208 | && !all.contains(wearing) |
| 209 | 209 | { |
| 210 | | all.push(wearing.clone()); |
| 210 | all.insert(built_in().len(), wearing.clone()); |
| 211 | 211 | } |
| 212 | 212 | let selected = wearing |
| 213 | 213 | .and_then(|wearing| all.iter().position(|theme| theme.id == wearing.id)) |
| ... | ... | @@ -296,6 +296,26 @@ impl State { |
| 296 | 296 | }, |
| 297 | 297 | ); |
| 298 | 298 | for (index, listed) in dialog.themes.iter().enumerate() { |
| 299 | let own = !stored::is_built_in(&listed.id); |
| 300 | if own && (index == 0 || stored::is_built_in(&dialog.themes[index - 1].id)) { |
| 301 | ui.open( |
| 302 | "rule", |
| 303 | Spec { |
| 304 | size: [fill(), px(7.0)], |
| 305 | pad: [4.0, 3.0], |
| 306 | ..Spec::default() |
| 307 | }, |
| 308 | ); |
| 309 | ui.leaf( |
| 310 | "line", |
| 311 | Spec { |
| 312 | size: [fill(), fill()], |
| 313 | fill: Some(theme.chip), |
| 314 | ..Spec::default() |
| 315 | }, |
| 316 | ); |
| 317 | ui.close(); |
| 318 | } |
| 299 | 319 | let shown = index == dialog.selected; |
| 300 | 320 | let item = ui.open( |
| 301 | 321 | ("theme", index), |
| ... | ... | @@ -357,17 +377,7 @@ impl State { |
| 357 | 377 | ..Spec::default() |
| 358 | 378 | }, |
| 359 | 379 | ); |
| 360 | | if built { |
| 361 | | ui.leaf( |
| 362 | | "locked", |
| 363 | | Spec { |
| 364 | | size: [fill(), px(row * 1.5)], |
| 365 | | text: Some("Changing a built-in theme edits a copy."), |
| 366 | | color: Some(theme.text_dim), |
| 367 | | ..Spec::default() |
| 368 | | }, |
| 369 | | ); |
| 370 | | } else { |
| 380 | if !built { |
| 371 | 381 | let edited = &mut dialog.themes[dialog.selected]; |
| 372 | 382 | let before = edited.name.clone(); |
| 373 | 383 | ui::text_field( |