Mesh:Tool: restore the dark-mode checkbox too (913977ec removed it)

The set_darkmode() restore missed that 913977ec also deleted the 'dark
mode' checkbox from api.settings() (src/mesh/build.js) - 'const dark =
true' + no toggle. Restored: reads space.dark, re-adds the checkbox
wired to call.set_darkmode().
This commit is contained in:
Stuart 2026-08-31 13:28:49 +10:00
commit e58ffd843a

View file

@ -275,9 +275,18 @@ api.welcome = function(version = "unknown") {
api.settings = function() {
const { prefs } = api;
const { surface, normals, space, sketch, wireframe } = prefs.map;
const dark = true;
// CMMS patch: upstream 913977ec hard-wired `const dark = true` and deleted
// the dark-mode checkbox. Restored - set_darkmode() (src/main/mesh.js) is
// conditional again and the CMMS host follows its own light/dark theme.
const dark = space.dark;
const set1 = div([
label({ class: "header", _: 'theme'}),
label('dark mode'),
input({ type: "checkbox",
onchange: ev => call.set_darkmode(ev.target.checked),
[ dark ? 'checked' : 'unchecked' ] : 1
}),
label({ class: "header", _: 'auto'}),
label('auto floor'),
input({ type: "checkbox",