From 629d48416058a1bd1d568ed7993cb413363155df Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Fri, 31 May 2024 23:35:42 -0400 Subject: [PATCH] fix a few mode visible elements --- src/kiri/init.js | 18 ++++++++++-------- src/kiri/ui.js | 6 +----- web/kiri/index.css | 6 +++--- web/kiri/index.html | 2 +- web/kiri/lang/en.js | 3 ++- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/kiri/init.js b/src/kiri/init.js index 568d62f5..29d0ee07 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1739,11 +1739,13 @@ gapp.register("kiri.init", [], (root, exports) => { deviceOrigin: newBoolean(LANG.dv_orgc_s, onBooleanClick, {title:LANG.dv_orgc_l, modes:FDM_LZR, show:() => !ui.deviceRound.checked}), deviceRound: newBoolean(LANG.dv_bedc_s, onBooleanClick, {title:LANG.dv_bedc_l, trigger:true, show:isNotBelt}), deviceBelt: newBoolean(LANG.dv_belt_s, onBooleanClick, {title:LANG.dv_belt_l, trigger:true, show:() => !ui.deviceRound.checked}), - extruder: newGroup(LANG.dv_gr_ext, $('device2'), {group:"dext", inline:true, modes:FDM}), + _____: newGroup(LANG.dv_gr_ext, $('device2'), {group:"dext", inline:true, modes:FDM}), extFilament: newInput(LANG.dv_fila_s, {title:LANG.dv_fila_l, convert:toFloat, modes:FDM}), extNozzle: newInput(LANG.dv_nozl_s, {title:LANG.dv_nozl_l, convert:toFloat, modes:FDM}), extOffsetX: newInput(LANG.dv_exox_s, {title:LANG.dv_exox_l, convert:toFloat, modes:FDM}), extOffsetY: newInput(LANG.dv_exoy_s, {title:LANG.dv_exoy_l, convert:toFloat, modes:FDM}), + extruder: newGroup(LANG.dv_gr_ext, $('device2'), {group:"dext", inline:true, modes:FDM}), + _____: newGroup(LANG.dv_gr_too, $('device2'), {group:"dext", inline:true, modes:CAM_LZR}), extSelect: newText(LANG.dv_exts_s, {title:LANG.dv_exts_l, size:14, height:3, area:gcode}), extDeselect: newText(LANG.dv_dext_s, {title:LANG.dv_dext_l, size:14, height:3, area:gcode}), extPad: newBlank({class:"grow", modes:FDM}), @@ -1752,7 +1754,7 @@ gapp.register("kiri.init", [], (root, exports) => { ui.extAdd = newButton(undefined, undefined, {icon:''}), ui.extDel = newButton(undefined, undefined, {icon:''}), ui.extNext = newButton(undefined, undefined, {icon:''}) - ], {class:"dev-buttons ext-buttons"}), + ], {class:"dev-buttons ext-buttons", modes:FDM}), palette: newGroup(LANG.dv_gr_pal, $('palette3'), {group:"dext2", inline:true, modes:FDM}), paletteId: newInput(LANG.dv_paid_s, {title:LANG.dv_paid_l, modes:FDM, size:15, text:true}), palettePing: newInput(LANG.dv_paps_s, {title:LANG.dv_paps_l, modes:FDM, convert:toInt}), @@ -1763,7 +1765,7 @@ gapp.register("kiri.init", [], (root, exports) => { paletteHeat: newInput(LANG.dv_pahe_s, {title:LANG.dv_pahe_l, modes:FDM, convert:toInt}), paletteCool: newInput(LANG.dv_paco_s, {title:LANG.dv_paco_l, modes:FDM, convert:toInt}), palettePress: newInput(LANG.dv_pacm_s, {title:LANG.dv_pacm_l, modes:FDM, convert:toInt}), - gcode: newGroup(LANG.dv_gr_out, $('device2'), {group:"dgco", inline:true, modes:CAM_LZR}), + _____: newGroup(LANG.dv_gr_out, $('device2'), {group:"dgco", inline:true, modes:CAM_LZR}), gcodeStrip: newBoolean(LANG.dv_strc_s, onBooleanClick, {title:LANG.dv_strc_l, modes:CAM}), gcodeSpace: newBoolean(LANG.dv_tksp_s, onBooleanClick, {title:LANG.dv_tksp_l, modes:CAM_LZR}), useLaser: newBoolean(LANG.dv_lazr_s, onBooleanClick, {title:LANG.dv_lazr_l, modes:CAM}), @@ -1785,13 +1787,13 @@ gapp.register("kiri.init", [], (root, exports) => { /** Preferences Menu */ - lprefs: newGroup(LANG.op_menu, $('prefs-gen1'), {inline: true}), + _____: newGroup(LANG.op_menu, $('prefs-gen1'), {inline: true}), antiAlias: newBoolean(LANG.op_anta_s, booleanSave, {title:LANG.op_anta_l}), reverseZoom: newBoolean(LANG.op_invr_s, booleanSave, {title:LANG.op_invr_l}), ortho: newBoolean(LANG.op_orth_s, booleanSave, {title:LANG.op_orth_l}), dark: newBoolean(LANG.op_dark_s, booleanSave, {title:LANG.op_dark_l}), devel: newBoolean(LANG.op_devl_s, booleanSave, {title:LANG.op_devl_l}), - lprefs: newGroup(LANG.op_disp, $('prefs-gen2'), {inline: true}), + _____: newGroup(LANG.op_disp, $('prefs-gen2'), {inline: true}), showOrigin: newBoolean(LANG.op_shor_s, booleanSave, {title:LANG.op_shor_l}), showRulers: newBoolean(LANG.op_shru_s, booleanSave, {title:LANG.op_shru_l}), showSpeeds: newBoolean(LANG.op_sped_s, speedSave, {title:LANG.op_sped_l}), @@ -1800,19 +1802,19 @@ gapp.register("kiri.init", [], (root, exports) => { lineType: newSelect(LANG.op_line_s, {title: LANG.op_line_l, action: lineTypeSave, modes:FDM}, "linetype"), animesh: newSelect(LANG.op_anim_s, {title: LANG.op_anim_l, action: aniMeshSave, modes:CAM}, "animesh"), units: newSelect(LANG.op_unit_s, {title: LANG.op_unit_l, action: unitsSave, modes:CAM, trace:false}, "units"), - layout: newGroup(LANG.lo_menu, $('prefs-lay'), {inline: true}), + _____: newGroup(LANG.lo_menu, $('prefs-lay'), {inline: true}), autoSave: newBoolean(LANG.op_save_s, booleanSave, {title:LANG.op_save_l}), autoLayout: newBoolean(LANG.op_auto_s, booleanSave, {title:LANG.op_auto_l}), freeLayout: newBoolean(LANG.op_free_s, booleanSave, {title:LANG.op_free_l}), spaceRandoX: newBoolean(LANG.op_spcx_s, booleanSave, {title:LANG.op_spcx_l, show:isBelt}), spaceLayout: newInput(LANG.op_spcr_s, {title:LANG.op_spcr_l, convert:toFloat, size:3, units:true}), - export: newGroup(LANG.xp_menu, $('prefs-xpo'), {inline: true}), + _____: newGroup(LANG.xp_menu, $('prefs-xpo'), {inline: true}), exportLocal: newBoolean(`Grid:Local`, booleanSave, {title:LANG.op_exgl_l}), exportGhost: newBoolean(`Grid:Host`, booleanSave, {title:LANG.op_exgh_l}), exportOcto: newBoolean(`OctoPrint`, booleanSave, {title:LANG.op_exop_l}), exportThumb: newBoolean(`Thumbnail`, booleanSave, {modes:FDM}), exportPreview: newBoolean(`Code Preview`, booleanSave), - parts: newGroup(LANG.pt_menu, $('prefs-prt'), {inline: true}), + _____: newGroup(LANG.pt_menu, $('prefs-prt'), {inline: true}), detail: newSelect(LANG.pt_qual_s, {title: LANG.pt_qual_l, action: detailSave}, "detail"), healMesh: newBoolean(LANG.pt_heal_s, booleanSave, {title: LANG.pt_heal_l}), threaded: newBoolean(LANG.pt_thrd_s, booleanSave, {title: LANG.pt_thrd_l, modes:FDM_CAM_SLA}), diff --git a/src/kiri/ui.js b/src/kiri/ui.js index 7711b2f9..b8f45cf2 100644 --- a/src/kiri/ui.js +++ b/src/kiri/ui.js @@ -338,9 +338,6 @@ gapp.register("kiri.ui", [], (root, exports) => { } function addModeControls(el, opt = {}) { - if (opt.trace2) { - console.log({ AMC: el, opt, groupName }); - } el.__opt = opt; el.showMe = function() { el.classList.remove('hide'); @@ -349,7 +346,6 @@ gapp.register("kiri.ui", [], (root, exports) => { el.classList.add('hide'); }; el.setVisible = function(show) { - if (opt.trace2) console.log({ setVisible: show, el }); if (show) el.showMe(); else el.hideMe(); }; @@ -357,7 +353,7 @@ gapp.register("kiri.ui", [], (root, exports) => { let xprt = opt.expert === undefined || (opt.expert === lastExpert); let show = opt.show ? safecall(opt.show) : true; let disp = opt.visible ? opt.visible() : true; - if (opt.trace2) console.log({ setMode: el, mode, modes: el.modes, xprt, show, disp, fn: el.__opt.show }); + if (opt.manual) return; el.setVisible(el.hasMode(mode) && show && xprt && disp); } el.hasMode = function(mode) { diff --git a/web/kiri/index.css b/web/kiri/index.css index 4dbb9f19..f38ba2b4 100644 --- a/web/kiri/index.css +++ b/web/kiri/index.css @@ -690,7 +690,7 @@ th, tr, td, label { align-items: center; } #ws-widgets button.selected { - background-color: var(--blue-4); + background-color: var(--blue-3); color: #000; } .slim-hide { @@ -1944,14 +1944,14 @@ th, tr, td, label { padding: 4px; margin: 3px; } -.set2-group .var-row { +.set2-group .var-row, .var-row { background: #fff; padding: 1px 4px 1px 4px; margin: 0 !important; border-left: 3px solid transparent; border-right: 3px solid transparent; } -.set2-group .var-row:hover { +.set2-group .var-row:hover, .var-row:hover { border-right: 3px solid var(--blue-1); background-color: var(--blue-4) !important; } diff --git a/web/kiri/index.html b/web/kiri/index.html index 10b9a3fb..e307b356 100644 --- a/web/kiri/index.html +++ b/web/kiri/index.html @@ -172,7 +172,7 @@
- +
diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 15ab1294..fbb8718f 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -27,7 +27,7 @@ self.kiri.lang['en-us'] = { import: "import", language: "language", left: "left", - machine: "machine", // device or machine + machines: "machines", // device or machine mesh: "mesh", // mesh editing metric: "metric", name: "name", @@ -95,6 +95,7 @@ self.kiri.lang['en-us'] = { // DEVICE dialog groups dv_gr_dev: "device", dv_gr_ext: "extruder", + dv_gr_too: "tool", dv_gr_pal: "palette", dv_gr_out: "output", dv_gr_gco: "gcode macros",