git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commit37d02fa81b4ac5a4a1c307c70e87eedc0df2a068
parent7fca44225c
authorLucas Galante <[email protected]>
date2026-09-21 12:26
Settings: Wireframe Single Color beside Wireframe Color

The wire pass draws in the wire colour only in single-colour mode
(Render node "Wire Single Color", off by default); off, the wires carry
the geometry's vertex colours unlit and the colour row sets their alpha
alone. The Wireframe section exposed the colour without that switch, so
a colour set there looked ignored — black wires stayed white on a pale
sphere. The switch now sits beside the colour, both owned by the Render
node.

The test edits both rows through the dialog's own write path and
asserts the live wire colour lands and the mode turns on.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

 src/dialog.rs | 12 +++++++++---
 src/main.rs   | 13 +++++++++++++
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/src/dialog.rs b/src/dialog.rs
index a0a3089..7374ea2 100644
--- a/src/dialog.rs
+++ b/src/dialog.rs
@@ -849,9 +849,10 @@ impl Setting {
 /// the render subnet (per-project look), the pane-visibility toggles (the
 /// View menu and the plate corners already own those, and a settings dialog
 /// is a strange place to hide a pane from), and keybindings, which this DE
-/// edits as `input.kdl` on purpose. The one exception is the wire colour:
-/// the palette's Wireframe Color command lands on it, so it is a row here,
-/// its owner still the Render node — per-project, unlike the rest of this
+/// edits as `input.kdl` on purpose. The one exception is the wireframe
+/// pair: the palette's Wireframe Color command lands on the colour, so it
+/// is a row here with the single-colour switch that makes it apply, their
+/// owner still the Render node — per-project, unlike the rest of this
 /// table.
 pub const SETTINGS: &[Setting] = &[
     Setting::section("Viewport"),
@@ -859,6 +860,11 @@ pub const SETTINGS: &[Setting] = &[
     Setting::row("Square Aspect", Owner::Command("toggle_square_viewport")),
     Setting::section("Wireframe"),
     Setting::row("Wireframe Color", Owner::Subnet("Render", "Wire Color")),
+    // The colour applies only in single-colour mode (off, the wires carry
+    // the geometry's vertex colours and the colour row sets their alpha
+    // alone) — so the switch sits beside the colour, or a colour set here
+    // looks ignored.
+    Setting::row("Wireframe Single Color", Owner::Subnet("Render", "Wire Single Color")),
     Setting::section("Grid"),
     Setting::row("Show Grid", Owner::Subnet("Guides", "Show Grid Guide")),
     Setting::row("Grid Color", Owner::Subnet("Guides", "Grid Color")),
diff --git a/src/main.rs b/src/main.rs
index 583d506..db6c5e0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4071,8 +4071,21 @@ mod tests {
         assert_eq!(state.dialog_tab(), Tab::Settings);
         let shown = state.dialog_settings_shown.clone();
         assert!(shown.iter().any(|(k, _, t)| k == "Wireframe Color" && t == "rgba"), "{shown:?}");
+        assert!(shown.iter().any(|(k, _, t)| k == "Wireframe Single Color" && t == "toggle"), "{shown:?}");
         let s = crate::dialog::SETTINGS.iter().find(|s| s.label == "Wireframe Color").unwrap();
         assert_eq!(s.owner, Some(crate::dialog::Owner::Subnet("Render", "Wire Color")));
+
+        // Editing both rows reaches the live state: the colour AND the switch
+        // that makes the wire pass use it (off, the wires carry the
+        // geometry's colours and the colour row is their alpha alone).
+        assert!(!state.wire_single_color, "single-colour mode is off by default");
+        let mut rows = state.dialog_settings_shown.clone();
+        rows.iter_mut().find(|(k, _, _)| k == "Wireframe Color").unwrap().1 = "#000000ff".to_string();
+        rows.iter_mut().find(|(k, _, _)| k == "Wireframe Single Color").unwrap().1 = "true".to_string();
+        state.slots.dialog_params_mut().set_display_params(&rows);
+        state.sync_dialog_settings_to_project();
+        assert_eq!(state.wire_color, [0.0, 0.0, 0.0, 1.0], "the colour row writes the live wire colour");
+        assert!(state.wire_single_color, "the switch row turns single-colour mode on");
     }
 
     /// The wireframe toggle is a palette row that flips the live flag AND