From 8c3ab04bf4e8a8c842fb320e0503510baea25f16 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Tue, 17 Nov 2026 14:06:05 +0100 Subject: [PATCH] Keep theme picker open while previewing themes --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/canvas-pilot/src/menu_ui.rs | 12 ++++++------ docs/canvas-pilot/changelog.md | 5 +++++ docs/canvas-pilot/guide/preferences.md | 4 +++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8cd6fd7..d0dc1f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -548,7 +548,7 @@ dependencies = [ [[package]] name = "canvas-pilot" -version = "0.9.20" +version = "0.9.21" dependencies = [ "base64", "craft-dwg", diff --git a/Cargo.toml b/Cargo.toml index d266e35..bbe4757 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["crates/canvas-pilot"] resolver = "3" [workspace.package] -version = "0.9.20" +version = "0.9.21" edition = "2024" license = "MIT" repository = "https://proxy.dandaedre.com/gitea/idle-org/canvas-pilot" diff --git a/crates/canvas-pilot/src/menu_ui.rs b/crates/canvas-pilot/src/menu_ui.rs index 1141dac..fea05f2 100644 --- a/crates/canvas-pilot/src/menu_ui.rs +++ b/crates/canvas-pilot/src/menu_ui.rs @@ -263,7 +263,6 @@ impl Editor { }); if let Some(choice) = selected { choice.apply(ctx); - self.themes_open = false; self.settings.save(&self.application_settings(ctx)); } } @@ -524,13 +523,14 @@ mod tests { let ctx = egui::Context::default(); let boxes = app.layout.layers().clone(); let formats = app.layout.formats().clone(); + click_label(&mut app, &ctx, "Menu"); + click_label(&mut app, &ctx, "Options"); + let label = format!("Theme: {}", theme::Theme::current(&ctx).name()); + click_label(&mut app, &ctx, &label); + click_label(&mut app, &ctx, "More themes…"); for choice in theme::Theme::ALL { - click_label(&mut app, &ctx, "Menu"); - click_label(&mut app, &ctx, "Options"); - let label = format!("Theme: {}", theme::Theme::current(&ctx).name()); - click_label(&mut app, &ctx, &label); - click_label(&mut app, &ctx, "More themes…"); click_label(&mut app, &ctx, choice.name()); + assert!(app.themes_open); assert!(theme::Theme::current(&ctx) == choice); assert_eq!(ctx.global_style().visuals.dark_mode, !choice.is_light()); let output = frame(&mut app, &ctx, vec![]); diff --git a/docs/canvas-pilot/changelog.md b/docs/canvas-pilot/changelog.md index 6799101..4234a61 100644 --- a/docs/canvas-pilot/changelog.md +++ b/docs/canvas-pilot/changelog.md @@ -4,6 +4,11 @@ ## Unreleased +### v0.9.21 + +- Keep the More themes picker open after each selection so multiple themes can + be previewed before closing it. Each choice still applies and saves immediately. + ### v0.9.20 - Added a full-width No folder drop area and widened the heading drop target to diff --git a/docs/canvas-pilot/guide/preferences.md b/docs/canvas-pilot/guide/preferences.md index 3e5cd92..d9c5c8d 100644 --- a/docs/canvas-pilot/guide/preferences.md +++ b/docs/canvas-pilot/guide/preferences.md @@ -108,7 +108,9 @@ used themes, newest first. **More themes…** opens the complete picker with col swatches: Midra Dark plus all 18 themes from the SOTV song-database theme folder. A fresh installation lists only Midra Dark until other themes are selected. Selecting a theme updates the UI and viewport immediately and saves the recent -history across restarts. Reusing a theme moves it to the top without duplicates. +history across restarts. The picker stays open so you can try several themes; +close it with its window close button when finished. Reusing a theme moves it to +the top without duplicates. Closing the picker without choosing leaves the theme and history unchanged. The viewport, grid, layer boxes and source test patterns use the selected palette;