From 35312061e50cf3eb998cc8742602cc63a68bace7 Mon Sep 17 00:00:00 2001 From: David Mann Date: Sun, 29 Nov 2026 16:19:11 +0100 Subject: [PATCH 1/2] Preferences: Memory Usage Percent labels itself, so its label shows once craft-libs 8c807a9a0 shows a check box's own label when it sits in a row inside the field that names it, so the row showed "Memory Usage Percent" twice. The row now draws its own label, on the check box, and the window adds none, as for Rendering Mode. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/prefs/prefs_ui/fields.rs | 14 ++++---------- crates/ui-egui/src/prefs/prefs_ui/tests.rs | 4 ++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/crates/ui-egui/src/prefs/prefs_ui/fields.rs b/crates/ui-egui/src/prefs/prefs_ui/fields.rs index 851e49dfea..3ec167fe52 100644 --- a/crates/ui-egui/src/prefs/prefs_ui/fields.rs +++ b/crates/ui-egui/src/prefs/prefs_ui/fields.rs @@ -165,19 +165,13 @@ pub(super) fn rules(ctx: &egui::Context) -> Vec { } // Rows the app draws itself (`PrefsCustom`). - for path in [ - "performance.memoryUsagePercent", - "performance.gpuAdapter", - "tools.pressureCurve", - "scratchDisks.disks", - "fileHandling.recentFiles", - "type.favoriteFonts", - ] { + for path in ["performance.gpuAdapter", "tools.pressureCurve", "scratchDisks.disks", "fileHandling.recentFiles", "type.favoriteFonts"] { tweak(&mut rules, path, |r| r.custom()); } // Rows that draw their own label or heading, so the window adds none: the Appearance page (Appearance Mode, the - // themes), Rendering Mode's select and the Memory Usage block. - for path in ["interface.appearanceMode", "performance.renderingMode", "performance.memoryUsageMb"] { + // themes), Rendering Mode's select, the Memory Usage block and Memory Usage Percent's check box, which shows its + // label after the box as a check box in a row does. + for path in ["interface.appearanceMode", "performance.renderingMode", "performance.memoryUsageMb", "performance.memoryUsagePercent"] { tweak(&mut rules, path, |r| r.custom_rows()); } // The favourite fonts are the user's library, not a Type setting. diff --git a/crates/ui-egui/src/prefs/prefs_ui/tests.rs b/crates/ui-egui/src/prefs/prefs_ui/tests.rs index c1f7a080ef..ca25aab1d2 100644 --- a/crates/ui-egui/src/prefs/prefs_ui/tests.rs +++ b/crates/ui-egui/src/prefs/prefs_ui/tests.rs @@ -1837,8 +1837,8 @@ fn the_interface_page_lists_appearance_presentation_then_options_on_one_label_co } /// The rows of Preferences › Performance that draw their own label or heading show it once: the window adds no second -/// "Rendering mode" beside the select's own, and no "Memory usage (MB)" beside the Memory Usage heading. Memory Usage -/// Percent's check box shows no text, so the window's label is its only one. +/// "Rendering mode" beside the select's own, no "Memory usage (MB)" beside the Memory Usage heading, and no "Memory Usage +/// Percent" beside the check box's own. #[test] fn self_labelled_performance_rows_show_their_label_once() { let (_, files) = app_with_store(); From 9caca9d07efc72b0c0d82a19f3abc9e370affd3a Mon Sep 17 00:00:00 2001 From: David Mann Date: Sun, 29 Nov 2026 17:03:50 +0100 Subject: [PATCH 2/2] Custom paper test: the reveal scroll goes up past where the list opened 40 wheel steps down and 40 up only came back to the start, so a row above the opening position was never checked. 80 steps up reach it. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/dialogs/file_ui/custom_paper_tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/file_ui/custom_paper_tests.rs b/crates/ui-egui/src/dialogs/file_ui/custom_paper_tests.rs index 27f1fe7488..4f0dc6347b 100644 --- a/crates/ui-egui/src/dialogs/file_ui/custom_paper_tests.rs +++ b/crates/ui-egui/src/dialogs/file_ui/custom_paper_tests.rs @@ -94,9 +94,9 @@ pub(super) fn click(h: &mut Harness<'_, Box>, label: &str) { /// Scrolls the open paper list until the row `label` is shown: the list draws only the rows in view, so a row is not in /// the access tree until the wheel has brought it into view. The list can open scrolled to its chosen row, so the wheel -/// goes down first and then up. +/// goes down first and then up, past where it started. fn reveal(h: &mut Harness<'_, Box>, label: &str) { - for step in 0..80 { + for step in 0..120 { if h.query_by_label(label).is_some() { return; }