From f74fe090fce0064afda876fbb625c79bc5d88f58 Mon Sep 17 00:00:00 2001 From: David Mann Date: Wed, 25 Nov 2026 23:46:32 +0100 Subject: [PATCH] Preferences: an opt-in classic layout with a framed page list, group boxes and Prev/Next PreferencesLayout::Classic draws the paged body as a desktop preferences dialog does: the page list in a frame as tall as the page (SectionList::framed) with room before the page, no heading over the page, and each titled group a GroupBox. The window puts OK, Cancel, Prev and Next in a column at the end edge (ButtonPlace::Side) and opens at 1030 x 660; Prev and Next step through the listed pages and wrap. Paged and Cards are unchanged. PreferencesPageOutput::pages lists the page ids the search keeps. For storytold/photocraft#17014. Co-Authored-By: Claude Opus 5.5 --- .../src/patterns/form_dialogs/section_list.rs | 42 +++++-- .../src/patterns/preferences/page.rs | 61 ++++++--- .../src/patterns/preferences/window.rs | 62 +++++++++- .../src/patterns/preferences/words.rs | 2 + .../tests/it/preferences/classic.rs | 116 ++++++++++++++++++ .../ui-patterns/tests/it/preferences/mod.rs | 1 + 6 files changed, 247 insertions(+), 37 deletions(-) create mode 100644 crates/ui-patterns/tests/it/preferences/classic.rs diff --git a/crates/ui-patterns/src/patterns/form_dialogs/section_list.rs b/crates/ui-patterns/src/patterns/form_dialogs/section_list.rs index 8c9db50db..2a2ecb0cf 100644 --- a/crates/ui-patterns/src/patterns/form_dialogs/section_list.rs +++ b/crates/ui-patterns/src/patterns/form_dialogs/section_list.rs @@ -2,12 +2,13 @@ //! body and the properties dialog's list of tabs. use crate::contract::{ - ActivateOn, Bind, CollectionEvent, Props as _, Scroll, SelectMode, Show as _, ShowCollection as _, ShowContainer as _, Sizing, + ActivateOn, Bind, CollectionEvent, Gap, Pad, Props as _, Scroll, SelectMode, Show as _, ShowCollection as _, ShowContainer as _, Sizing, }; use crate::display::Divider; use crate::layout_components::{Row, Stack}; use crate::list::{List, ListRow}; use crate::runtime::env::Label; +use crate::style::SurfaceKind; use craft_behavior::{ItemSource, Selection, SelectionChange}; use egui::Ui; use std::hash::Hash; @@ -34,12 +35,13 @@ pub struct SectionList<'a, K: Clone + Eq + Hash + Send + Sync + 'static> { id: Option, body_label: Option