properly handle expanding preview in developer mode

This commit is contained in:
Stewart Allen 2025-12-25 22:16:13 -05:00
commit 1f663f3cc9
4 changed files with 22 additions and 4 deletions

View file

@ -1253,7 +1253,7 @@ self.kiri.load(api => {
} }
function prep_export(gen3mf, gcode, info, settings) { function prep_export(gen3mf, gcode, info, settings) {
if (!settings.device.extras?.bbl || api.ui.deviceSave.disabled) { if (!settings.device.extras?.bbl || api.ui.devices.save.disabled) {
$('bambu-output').style.display = 'none'; $('bambu-output').style.display = 'none';
return; return;
} }

View file

@ -328,7 +328,8 @@ function exportGCodeDialog(gcode, sections, info, names) {
api.modal.show('xany'); api.modal.show('xany');
let set = api.conf.get(); let set = api.conf.get();
let fdm = MODE === MODES.FDM; let fdm = MODE === MODES.FDM;
let octo = set.controller.exportOcto && MODE !== MODES.CAM; let cam = MODE === MODES.CAM;
let octo = set.controller.exportOcto && !cam;
let preview = set.controller.exportPreview; let preview = set.controller.exportPreview;
$('code-preview-head').style.display = preview ? '' : 'none'; $('code-preview-head').style.display = preview ? '' : 'none';
$('code-preview').style.display = preview ? '' : 'none'; $('code-preview').style.display = preview ? '' : 'none';
@ -337,8 +338,8 @@ function exportGCodeDialog(gcode, sections, info, names) {
$('print-filename').value = filename; $('print-filename').value = filename;
$('print-filesize').value = util.comma(info.bytes); $('print-filesize').value = util.comma(info.bytes);
$('print-length').value = Math.round(info.distance); $('print-length').value = Math.round(info.distance);
if (set.controller.devel) { if ((fdm || cam) && preview && set.controller.devel) {
$('code-preview-textarea').style.height = "30em"; document.body.classList.add('devel');
} }
calcTime(); calcTime();
if (fdm) { if (fdm) {

View file

@ -60,6 +60,9 @@ class ModalControl {
visible = modal.visible(), visible = modal.visible(),
info = { pct: 0 }; info = { pct: 0 };
// if the dialog needs it, it will re-add it
document.body.classList.remove('devel');
// hide all modals before showing another // hide all modals before showing another
Object.keys(modal.#ui.modals).forEach(name => { Object.keys(modal.#ui.modals).forEach(name => {
modal.#ui.modals[name].style.display = name === which ? 'flex' : ''; modal.#ui.modals[name].style.display = name === which ? 'flex' : '';

View file

@ -2615,3 +2615,17 @@ details[open] summary::after {
.range-detail span { .range-detail span {
flex-grow: 1; flex-grow: 1;
} }
.devel #modal-box {
height: 80%;
}
.devel #mod-x-any {
height: 100%;
}
.devel #code-preview {
flex-grow: 1;
}
.devel #code-preview > div,
.devel #code-preview-textarea {
height: 100%;
}