Move texture resolution to Display Settings and apply review fixes

Remove the Viewport section from Settings; the texture resolution is in
Display Settings > Render settings and the GPU memory toasts point there.
Add hovers to the Data folder and RAM slider, name the R button for screen
readers, test that Show world axes hides the 3D axes, and fix the docs
that still named the removed sections.
This commit is contained in:
vangel76 committed 2026-11-25 01:18:07 +01:00
1 parent af296eb5bc
commit 2c6222ecde
9 files changed
+66 -40

No files matched your search

+13 -3
View File
@@ -43,7 +43,7 @@ pub(crate) fn body(app: &mut TextureCraftApp, ui: &mut Ui) {
0 => import_hdr = environment(app, ui, &mut display),
1 => camera(app, ui, &mut display),
2 => post_effects(ui, &mut display),
3 => render_settings(ui, &mut display),
3 => render_settings(app, ui, &mut display),
_ => visualization(app, ui, &mut display),
});
@@ -255,9 +255,19 @@ fn post_effects(ui: &mut Ui, display: &mut DisplaySettings) {
}
}
/// Temporal anti-aliasing
fn render_settings(ui: &mut Ui, display: &mut DisplaySettings) {
/// Temporal anti-aliasing and the viewport texture resolution (an app setting, not the project's)
fn render_settings(app: &mut TextureCraftApp, ui: &mut Ui, display: &mut DisplaySettings) {
ui.checkbox(&mut display.taa, tr("Temporal anti-aliasing (refines the 3D view while it is still)"));
ui.horizontal(|ui| {
ui.label(tr("Texture resolution"));
for (value, label) in [(0_u8, tr("Full")), (1, tr("Half")), (2, tr("Quarter"))] {
ui.selectable_value(&mut app.ui.prefs.viewport_texture, value, label);
}
})
.response
.on_hover_text(tr(
"Size of the textures the viewport shows: lower uses less GPU memory with large texture sets. Painting and export keep full resolution.",
));
}
/// The mesh wireframe and the single-channel views
+1 -1
View File
@@ -1014,7 +1014,7 @@ const GLIDE_SECONDS: f64 = 0.35;
/// The share of the running frame rate and frame time averages each frame keeps (an average over about ten frames)
const FRAME_AVERAGE_KEEP: f32 = 0.9;
/// The interface scale applied: wider than the Settings slider, so a scale set elsewhere still applies within reason
/// The interface scale applied (`prefs.ui_scale`, set through `ui.set`; Settings has no control for it), clamped to a usable range
const UI_SCALE_APPLIED: std::ops::RangeInclusive<f32> = 0.5..=3.0;
/// Zoom factors closer than this are the same zoom (float noise), so the zoom is not set again each frame
const SAME_ZOOM_TOLERANCE: f32 = 1e-3;
+10 -16
View File
@@ -456,7 +456,12 @@ fn general(
{
let default = crate::local_cache_folder("").display().to_string();
ui.add(egui::TextEdit::singleline(&mut p.local_cache_directory).hint_text(default).desired_width(CONTROL_WIDTH - 24.0)).labelled_by(label);
if ui.add(egui::Button::new("R").frame(false)).on_hover_text(tr("Reset to the default folder")).clicked() {
let reset = ui.add(egui::Button::new("R").frame(false)).on_hover_text(tr("Reset to the default folder"));
// Screen readers hear what the single letter does
let name = format!("R, {}", tr("Reset to the default folder"));
reset.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, true, &name));
if reset.clicked() {
p.local_cache_directory.clear();
}
}
@@ -495,7 +500,9 @@ fn general(
#[cfg(not(target_arch = "wasm32"))]
row(ui, tr("Data folder"), |ui, label| {
let default = crate::data_folder("").display().to_string();
ui.add(egui::TextEdit::singleline(&mut p.data_folder).hint_text(default).desired_width(CONTROL_WIDTH - 30.0)).labelled_by(label);
ui.add(egui::TextEdit::singleline(&mut p.data_folder).hint_text(default).desired_width(CONTROL_WIDTH - 30.0))
.labelled_by(label)
.on_hover_text(tr("Applies on restart."));
if ui.button("...").on_hover_text(tr("Choose the data folder")).clicked() {
*pick = Some(SettingsFolder::DataFolder);
}
@@ -505,19 +512,6 @@ fn general(
disabled_text_check(ui, n_("Hardware support acceleration"), true);
// TextureCraft's own settings, after the reference sections
section(ui, n_("VIEWPORT"));
row(ui, tr("Texture resolution"), |ui, _| {
ui.horizontal(|ui| {
for (v, l) in [(0u8, tr("Full")), (1, tr("Half")), (2, tr("Quarter"))] {
ui.selectable_value(&mut p.viewport_texture, v, l);
}
})
.response
.on_hover_text(tr(
"Size of the textures the viewport shows: lower uses less GPU memory with large texture sets. Painting and export keep full resolution.",
));
});
section(ui, n_("RESOURCES"));
#[cfg(not(target_arch = "wasm32"))]
{
@@ -537,7 +531,7 @@ fn general(
cores_in_total(ui, available_cores);
});
row(ui, tr("Max RAM while saving"), |ui, label| {
ui.add(egui::Slider::new(&mut p.save_ram_percent, 0..=100).step_by(1.0).suffix(" %")).labelled_by(label);
ui.add(egui::Slider::new(&mut p.save_ram_percent, 0..=100).step_by(1.0).suffix(" %")).labelled_by(label).on_hover_text(tr("0 % uses at least 1 %"));
let budget_bytes = texturecraft_engine::formats::save_ram_budget(available_ram_bytes, p.save_ram_percent);
ui.label(format!("≈ {:.2} GiB", budget_bytes as f64 / (1_u64 << 30) as f64));
});
+2 -2
View File
@@ -405,7 +405,7 @@ fn gpu_report_toasts(app: &mut TextureCraftApp, reports: crate::gpu::GpuReports)
}
let text = match sets.as_slice() {
[one] => trf(
"Not enough GPU memory to show texture set \"{name}\" fully: lower the viewport Texture resolution in Settings. Painting and export are not affected.",
"Not enough GPU memory to show texture set \"{name}\" fully: lower the Texture resolution in Display Settings › Render settings. Painting and export are not affected.",
&[("name", one)],
),
many => {
@@ -418,7 +418,7 @@ fn gpu_report_toasts(app: &mut TextureCraftApp, reports: crate::gpu::GpuReports)
list.push_str(", ...");
}
trf(
"Not enough GPU memory to show {count} texture sets fully ({names}): lower the viewport Texture resolution in Settings. Painting and export are not affected.",
"Not enough GPU memory to show {count} texture sets fully ({names}): lower the Texture resolution in Display Settings › Render settings. Painting and export are not affected.",
&[("count", &many.len()), ("names", &list)],
)
}
+32 -14
View File
@@ -87,7 +87,7 @@ fn the_general_page_starts_at_the_reference_defaults() {
let mut h = harness(texturecraft_engine::sample_session(128, 32).unwrap());
open_settings(&mut h);
// A reset puts the defaults in the window; the app itself keeps English for the exact-text checks
// The defaults of a first start, in the window; the app itself keeps English for the exact-text checks
h.state_mut().ui.windows.settings_draft.as_mut().unwrap().prefs = Prefs::default();
h.run_steps(3);
@@ -112,7 +112,7 @@ fn the_general_page_starts_at_the_reference_defaults() {
assert_eq!(texturecraft_ui_egui::local_cache_folder(&Prefs::default().local_cache_directory), std::env::temp_dir());
let prefs = Prefs::default();
assert_eq!(prefs.language, texturecraft_ui_egui::i18n::SYSTEM_LANGUAGE, "a reset follows the system language");
assert_eq!(prefs.language, texturecraft_ui_egui::i18n::SYSTEM_LANGUAGE, "the default follows the system language");
assert_eq!((prefs.rotation_speed, prefs.zoom_speed, prefs.wheel_speed), (2.0, 1.0, 1.0));
}
@@ -121,7 +121,7 @@ fn the_general_page_keeps_the_reference_sections_and_moves_data_folder_and_recen
let mut h = harness(Session::closed().unwrap());
open_settings(&mut h);
for gone in ["TEMPORARY FILES", "IRAY HARDWARE", "APPEARANCE", "FOLDERS", "PRIVACY", "Interface scale", "Accent color"] {
for gone in ["TEMPORARY FILES", "IRAY HARDWARE", "APPEARANCE", "FOLDERS", "VIEWPORT", "Interface scale", "Accent color"] {
assert!(h.query_by_label(gone).is_none(), "{gone} is not on the page");
}
for hint in ["Saving uses the other cores", "0 turns autosave off", "A new folder applies on restart"] {
@@ -160,11 +160,32 @@ fn the_resource_sliders_step_by_one_and_follow_the_arrow_keys() {
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);
assert_eq!(ram_percent(&h), before + 1, "the right arrow adds one percent");
let after_right = ram_percent(&h);
press_key(&mut h, Key::ArrowLeft);
press_key(&mut h, Key::ArrowLeft);
assert_eq!(ram_percent(&h), before - 1, "the left arrow takes one percent");
let after_left = ram_percent(&h);
assert_eq!(after_right, before + 1, "the right arrow adds one percent");
assert_eq!(after_left, before - 1, "the left arrow takes one percent");
}
#[test]
fn show_world_axes_draws_the_3d_view_axes_and_off_hides_them() {
let mut h = harness(texturecraft_engine::sample_session(128, 32).unwrap());
let painted_z = |h: &Harness<'_, TextureCraftApp>| {
h.output().shapes.iter().filter(|clipped| matches!(&clipped.shape, egui::Shape::Text(text) if text.galley.text() == "Z")).count()
};
h.state_mut().ui.prefs.show_world_axes = true;
h.run_steps(3);
let shown = painted_z(&h);
h.state_mut().ui.prefs.show_world_axes = false;
h.run_steps(3);
let hidden = painted_z(&h);
assert_eq!(shown, hidden + 1, "the 3D view's Z axis letter is drawn only while Show world axes is on");
}
#[test]
@@ -179,8 +200,8 @@ fn the_enabled_interface_options_answer_the_keyboard() {
h.run_steps(2);
press_key(&mut h, Key::Space);
}
let after = draft(&h);
assert_ne!(after.show_keyboard_helper, before.show_keyboard_helper);
assert_ne!(after.show_world_axes, before.show_world_axes);
assert_ne!(after.only_selected_material_when_painting, before.only_selected_material_when_painting);
@@ -194,14 +215,12 @@ fn the_local_cache_directory_takes_a_folder_and_r_goes_back_to_the_default() {
let stored = |h: &Harness<'_, TextureCraftApp>| h.state().ui.windows.settings_draft.as_ref().unwrap().prefs.local_cache_directory.clone();
type_into(&mut h, "Local cache directory", &folder);
assert_eq!(stored(&h), folder);
let typed = stored(&h);
click(&mut h, "R, Reset to the default folder");
let reset = stored(&h);
// 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");
assert_eq!(typed, folder);
assert!(reset.is_empty(), "R goes back to the default folder");
}
#[test]
@@ -534,7 +553,6 @@ fn gpu_raytracing_is_on_and_checkable_with_a_gpu_and_off_and_disabled_without()
assert_eq!(!check.accesskit_node().is_disabled(), supported, "it can be changed exactly when there is a GPU");
assert_eq!(toggled(&h, "Enable GPU raytracing"), supported, "it is on exactly when there is a GPU");
assert_eq!(h.query_by_label(GPU_RAYTRACING_UNAVAILABLE).is_some(), !supported, "the note shows with no GPU and only then");
assert!(h.state().ui.prefs.gpu_raytracing, "the stored choice stays for a machine with a GPU");
}
#[test]
+3
View File
@@ -83,6 +83,9 @@ fn empty_start_snapshot() {
harness.get_by_label("Edit").click();
harness.run_steps(3);
harness.get_by_label("Settings").click();
harness.run_steps(3);
harness.get_by_label("Recent projects limit").scroll_to_me();
harness.run_steps(3);
save(&mut harness, &output_dir, "settings-recent-project-limit");
assert!(!harness.get_by_label("Recent projects limit").accesskit_node().is_disabled());
}
+1
View File
@@ -334,6 +334,7 @@ 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`.
A `prefs` object without `language` sets the system language (`""`), the default.
## MCP server
+3 -3
View File
@@ -250,10 +250,10 @@ Everything TextureCraft does today, by area. What's still missing is in [`ROADMA
- **Swap 3D/2D** (F4, Viewport menu and the layout dropdown, rebindable) puts the 2D view on the left and the 3D view on the right in the split layout. Painting, the divider and the views' headers work on both sides, and the choice is kept with the UI state.
- A modern look in **four brightness levels** (dark, medium dark, medium light and light) with
**seven accent colors**, set in Settings › General › Appearance.
**seven accent colors**, set for now only through `ui.set` (`prefs.brightness`, `prefs.accent`).
- **Its own title bar** with the app icon, menus and window buttons on Windows (and on Linux
desktops that leave the frame to the app, such as GNOME), the macOS traffic lights over the same
strip, and Settings › General › Appearance › System title bar for the system's frame instead.
strip, and the system's frame instead with `prefs.system_title_bar` through `ui.set` (for now).
- **Dockable, tabbed and floating panels**, saved layouts, and panels that reopen where you closed
them. The right bar's panels (Export, Log, Display Settings, Shader Settings, History) pop out
beside it; *Undock* makes one a floating window, and its *Dock* button puts it back on the bar.
@@ -273,7 +273,7 @@ Everything TextureCraft does today, by area. What's still missing is in [`ROADMA
- **No project at launch**: empty views, panels and toolbars until you create or open one (File ›
New project, Open, Recent projects, Open sample project); File › Close returns to that state.
- A **data folder** of your choice for autosaves, smart materials, presets, templates and UI
layouts, on any drive (Settings › General › Folders; `Documents/TextureCraft` by default).
layouts, on any drive (Settings › General › Files › Data folder; `Documents/TextureCraft` by default).
- A **Settings window** (Edit › Settings) with General, Shortcuts and Libraries pages; changes
apply on OK and Cancel drops them. General holds the language (or the system's), the 3D view's
rotation, zoom and wheel speeds with inverse directions, GPU or CPU bake rays, resource limits
+1 -1
View File
@@ -154,7 +154,7 @@ that closes it back onto the bar; the float is saved with the UI state.
| UI-12 | Generator depth and property coverage | **UI + source.** The picker contains seven kinds. Switching to Position, changing Global balance and duplicating the effect worked. Shared global adjustments, resolution and input slots already exist; that does not establish the richer generator/control inventory in [#374](https://github.com/storytold/texturecraft/issues/374) | Audit each generator's inputs, micro-detail behavior and controls against the reference; do not count seven shared implementations as equivalent to its whole catalog |
| UI-13 | Narrow workspace readability | **UI.** At 1280 × 800 the app rendered, both views stayed visible and the toolbar exposed scroll arrows. Layer names/types became heavily truncated, the layer toolbar wrapped, and Properties needed scrolling. This was not an input-failure or docking-persistence test | Repeat the editing tasks at smaller sizes, widen/rearrange panels, check full-name tooltips and keyboard access, and retain the layout after restart. Since then: the Layers toolbar stays on one row at 1280 × 800 (its channel box shrinks), and a cut-short layer name or type shows in full on hover. Properties scrolling and restart persistence are unchanged |
| UI-14 | Assets panel filters | **UI + source.** The type dropdown lists the reference entries in its order, Fonts and Show all included. Saved searches and Filter by path are separate scrollable panes with a divider that supports pointer and keyboard resizing and saves its position with the UI state ([#640](https://github.com/storytold/texturecraft/issues/640)). Fonts, the built-in saved searches Favorites, 3D Assets and Flattened layers, and the System fonts and User fonts libraries are listed but greyed with "Not available yet" | Give fonts, favorites, 3D assets and flattened layers real assets, then enable those rows and check that each one filters the grid |
| UI-15 | Edit > Settings ([#637](https://github.com/storytold/texturecraft/issues/637)) | **Source + headless UI tests.** The window has the reference's General, Shortcuts and Libraries pages with OK and Cancel, and the General sections in its order (no Privacy section: TextureCraft sends no usage data). Language (Default (System Language) by default and after a reset), the camera rotation, zoom and wheel speeds with Inverse direction, Show world axes (the 3D view's X, Y and Z corner), the Shortcuts page and adding or removing library locations work. Enable GPU raytracing is on and can be changed when there is a GPU, and off and disabled without one ([#823](https://github.com/storytold/texturecraft/issues/823)). Show keyboard helper and Save preprocessed scene files (on), Only display the selected material when painting (off), Enable live preview baking process (on), Viewport Scaling (only Auto) and the Local cache directory (empty is the system's temporary folder; R goes back to it) can be changed and are kept, but have no effect yet. Default UV scale for materials, simplified thumbnails, the preview cache budget and shader, the Files cache directory and sparse virtual texture are shown disabled with "Not available yet". There is no IRAY HARDWARE section. A location's Default choice is fixed to your_assets. The Shortcuts page has the sections Actions, Mouse shortcuts and Modifiers shortcuts and a Reset all to default button; Delete clears a binding; a shared shortcut shows a warning naming the other action, a warning on the page icon and the footer "One or several errors have been found in Shortcuts settings", and OK stays disabled until it is gone (the mouse and modifier rows are shown disabled, the viewports read those gestures from code). The shortcut list uses the reference's action names, order and default keys ("Open project", "Show/Hide manipulator" Q to "Rotate tool" E after "Export Textures...", "Save as project", "Switch to baking mode" Ctrl+Shift+B, "Switch to edition mode" F9, "Camera projection: Perspective view" F5, "Show entire mesh/path", "Select next camera" `>`, "Select previous camera" `<`, "Viewers layout: 3D/2D" F1 to "Viewers layout: Swap 3D/2D" F4 and so on); Quit keeps Ctrl+Q and the menus keep their own texts. "Show mesh wireframe" is a new bindable command without a key; "Show/Hide manipulator", "Increase the manipulator size", "Decrease the manipulator size", "Cycle through manipulation spaces", "Toggle warp edition mode", "Translate tool", "Rotate tool", "Pause Engine Computation" (Shift+Esc) and "Toggle animation" (Space) are listed disabled with "Not available yet". The window reopens on the page it was closed on. With a project open the Libraries page hides the add row and shows "Library locations can't be added/removed when a project is opened."; the default library's "−" says "Cannot remove the default library.". "GPU raytracing not available for your hardware." shows under the Baking options when there is no GPU. The reference's TEMPORARY FILES section is called FILES and also holds the Data folder. TextureCraft's own settings follow the reference sections: VIEWPORT (texture resolution), RESOURCES (Max CPU threads for work, default every thread, and Cores kept for the UI as sliders in steps of 1 with the core count beside them, Max RAM while saving as a 0-100% slider, Max project size on open, Recent projects limit) and AUTOSAVE. There is no appearance, folders or analytics section: interface scale, brightness, accent colour and the system title bar stay in the saved settings and `ui.set` | Run the window in the native app; wire each disabled control as its function lands |
| UI-15 | Edit > Settings ([#637](https://github.com/storytold/texturecraft/issues/637)) | **Source + headless UI tests.** The window has the reference's General, Shortcuts and Libraries pages with OK and Cancel, and the General sections in its order (no Privacy section: TextureCraft sends no usage data). Language (Default (System Language) by default and after a reset), the camera rotation, zoom and wheel speeds with Inverse direction, Show world axes (the 3D view's X, Y and Z corner), the Shortcuts page and adding or removing library locations work. Enable GPU raytracing is on and can be changed when there is a GPU, and off and disabled without one ([#823](https://github.com/storytold/texturecraft/issues/823)). Show keyboard helper (on), Only display the selected material when painting (off), Save preprocessed scene files (on), Enable live preview baking process (on) and the Local cache directory (empty is the system's temporary folder; R goes back to it) can be changed and are kept, but have no effect yet. Viewport Scaling opens but lists only Auto, so there is nothing to change. Default UV scale for materials, simplified thumbnails, the preview cache budget and shader, the Files cache directory and sparse virtual texture are shown disabled with "Not available yet". There is no IRAY HARDWARE section. A location's Default choice is fixed to your_assets. The Shortcuts page has the sections Actions, Mouse shortcuts and Modifiers shortcuts and a Reset all to default button; Delete clears a binding; a shared shortcut shows a warning naming the other action, a warning on the page icon and the footer "One or several errors have been found in Shortcuts settings", and OK stays disabled until it is gone (the mouse and modifier rows are shown disabled, the viewports read those gestures from code). The shortcut list uses the reference's action names, order and default keys ("Open project", "Save as project", "Switch to baking mode" Ctrl+Shift+B, "Switch to edition mode" F9, "Camera projection: Perspective view" F5, "Show entire mesh/path", "Select next camera" `>`, "Select previous camera" `<`, "Viewers layout: 3D/2D" F1 to "Viewers layout: Swap 3D/2D" F4 and so on); Quit keeps Ctrl+Q and the menus keep their own texts. "Show mesh wireframe" is a new bindable command without a key; "Pause Engine Computation" (Shift+Esc) and "Toggle animation" (Space) are listed disabled with "Not available yet". The reference's rows after "Export Textures..." are listed the same way, in its order: "Show/Hide manipulator" (Q), "Increase the manipulator size", "Decrease the manipulator size" (-), "Cycle through manipulation spaces" (T), "Toggle warp edition mode" (Shift+V), "Translate tool" (W) and "Rotate tool" (E). The window reopens on the page it was closed on. With a project open the Libraries page hides the add row and shows "Library locations can't be added/removed when a project is opened."; the default library's "−" says "Cannot remove the default library.". "GPU raytracing not available for your hardware." shows under the Baking options when there is no GPU. The reference's TEMPORARY FILES section is called FILES and also holds the Data folder. TextureCraft's own settings follow the reference sections: RESOURCES (Max CPU threads for work, default every thread, and Cores kept for the UI as sliders in steps of 1 with the core count beside them, Max RAM while saving as a 0-100% slider, Max project size on open, Recent projects limit) and AUTOSAVE. There is no appearance, viewport, folders or analytics section: the viewport texture resolution (Full, Half, Quarter) is in Display Settings › Render settings, and interface scale, brightness, accent color and the system title bar stay in the saved settings and `ui.set` | Run the window in the native app; wire each disabled control as its function lands |
Bake workflow (issue [#651](https://github.com/storytold/texturecraft/issues/651)): Mesh Map Bakers
has a Presets menu (save, load, delete named bake settings; Apply to All Texture Sets) and a finished