authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-03 01:42:14-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-03 05:19:31-07:00
log5c06254186b809c75c62d772681c40f0cb9152d4
tree07f377e22aad3f08eb5da89efe42b7f0ebb272eb
parent85d15e3b338fc25a2a0802e7893bc82e48090d57
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

fix: the Themes dialog rules off its own themes from the built-in ones, without the note on editing a copy

Assisted-by: claude-opus-5.5

1 files changed, 23 insertions(+), 13 deletions(-)

crates/snowbound/src/themes.rs+23-13
...@@ -203,11 +203,11 @@ impl State {...@@ -203,11 +203,11 @@ impl State {
203 section: Option<u32>,203 section: Option<u32>,
204 ) {204 ) {
205 let mut all = library.themes().all();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 if let Some(wearing) = &wearing207 if let Some(wearing) = &wearing
208 && !all.contains(wearing)208 && !all.contains(wearing)
209 {209 {
210 all.push(wearing.clone());210 all.insert(built_in().len(), wearing.clone());
211 }211 }
212 let selected = wearing212 let selected = wearing
213 .and_then(|wearing| all.iter().position(|theme| theme.id == wearing.id))213 .and_then(|wearing| all.iter().position(|theme| theme.id == wearing.id))
...@@ -296,6 +296,26 @@ impl State {...@@ -296,6 +296,26 @@ impl State {
296 },296 },
297 );297 );
298 for (index, listed) in dialog.themes.iter().enumerate() {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 let shown = index == dialog.selected;319 let shown = index == dialog.selected;
300 let item = ui.open(320 let item = ui.open(
301 ("theme", index),321 ("theme", index),
...@@ -357,17 +377,7 @@ impl State {...@@ -357,17 +377,7 @@ impl State {
357 ..Spec::default()377 ..Spec::default()
358 },378 },
359 );379 );
360 if built {380 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 {
371 let edited = &mut dialog.themes[dialog.selected];381 let edited = &mut dialog.themes[dialog.selected];
372 let before = edited.name.clone();382 let before = edited.name.clone();
373 ui::text_field(383 ui::text_field(