From af296eb5bc8256bad0c7af6effed4ff62f59c62c Mon Sep 17 00:00:00 2001 From: vangel76 Date: Wed, 25 Nov 2026 00:56:44 +0100 Subject: [PATCH] Scroll to R before clicking it and document the new settings fields --- crates/ui-egui/src/state.rs | 3 ++- crates/ui-egui/tests/it/settings_window.rs | 5 +++++ docs/control-protocol.md | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 9d97f54d..bfd72af9 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -167,7 +167,8 @@ pub struct Prefs { pub reserved_cores: u32, /// Maximum decompressed project size accepted on open, in GiB (at least one). pub project_open_limit_gib: u32, - /// Percent of the free RAM a project save may hold at once (desktop; 1 to 100). + /// Percent of the free RAM a project save may hold at once (desktop; 0 to 100, a save holds + /// at least 1). pub save_ram_percent: u8, /// Worker threads for painting, baking and export (desktop; 0: one per logical CPU). Read at /// startup, before the first parallel job. diff --git a/crates/ui-egui/tests/it/settings_window.rs b/crates/ui-egui/tests/it/settings_window.rs index 7ca014c9..d3040990 100644 --- a/crates/ui-egui/tests/it/settings_window.rs +++ b/crates/ui-egui/tests/it/settings_window.rs @@ -156,6 +156,8 @@ fn the_resource_sliders_step_by_one_and_follow_the_arrow_keys() { let ram_percent = |h: &Harness<'_, TextureCraftApp>| h.state().ui.windows.settings_draft.as_ref().unwrap().prefs.save_ram_percent; let before = ram_percent(&h); + h.get_by_role_and_label(Role::Slider, "Max RAM while saving").scroll_to_me(); + h.run_steps(3); h.get_by_role_and_label(Role::Slider, "Max RAM while saving").focus(); h.run_steps(2); press_key(&mut h, Key::ArrowRight); @@ -194,6 +196,9 @@ fn the_local_cache_directory_takes_a_folder_and_r_goes_back_to_the_default() { type_into(&mut h, "Local cache directory", &folder); assert_eq!(stored(&h), folder); + // The Files cache directory's R stays disabled; the local cache's R is the one that works + h.query_all_by_label("R").find(|node| !node.accesskit_node().is_disabled()).unwrap().scroll_to_me(); + h.run_steps(3); h.query_all_by_label("R").find(|node| !node.accesskit_node().is_disabled()).unwrap().click(); h.run_steps(3); assert!(stored(&h).is_empty(), "R goes back to the default folder"); diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 7873145d..e2d4b3ca 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -326,7 +326,11 @@ Other preferences set through `ui.set {"prefs": {...}}`: `language` (`""` follow language), `work_threads` (worker threads for painting, baking and export; 0 uses every logical CPU; read at startup), `rotation_speed` (default 2), `zoom_speed` and `wheel_speed` (default 1, each from 0.1 to 10) with `zoom_inverse` and `wheel_inverse`, `gpu_raytracing` (false keeps bake -rays on the CPU) and `libraries` (the folders the shelf scans for saved smart materials and masks). +rays on the CPU), `show_world_axes` (the 3D view's X, Y and Z corner, default true) and `libraries` +(the folders the shelf scans for saved smart materials and masks). `show_keyboard_helper`, +`only_selected_material_when_painting`, `save_preprocessed_scene_files`, `live_preview_baking` and +`local_cache_directory` (empty: the system's temporary folder) are kept for Settings but have no +effect yet. For example, the `libraries` field can contain `[{"name": "Studio", "path": "/assets/studio"}]`. Use an absolute path on the host running TextureCraft. To change one preference, read `state.prefs` with `ui.inspect`, update that field and send the full `prefs` object to `ui.set`.