diff --git a/assets/webui/index.html b/assets/webui/index.html index 096776f..1a1ba1d 100644 --- a/assets/webui/index.html +++ b/assets/webui/index.html @@ -674,18 +674,18 @@
-

打印

+

打印设置

-
+
diff --git a/assets/webui/ofdgo.css b/assets/webui/ofdgo.css index e4a50ca..0b38dcf 100644 --- a/assets/webui/ofdgo.css +++ b/assets/webui/ofdgo.css @@ -33,12 +33,14 @@ .print-content { display: grid; grid-template-columns: 310px minmax(0, 1fr); + height: min(62dvh, 660px); + min-height: 240px; gap: 14px; } .print-settings { min-width: 0; - max-height: calc(100dvh - 230px); + max-height: 100%; margin: 0; padding: 0 8px 0 0; overflow: auto; @@ -64,28 +66,20 @@ .print-field > span { flex: none; color: var(--text-muted); white-space: nowrap; } .print-dialog .print-settings .print-margins input { padding: 0 3px; text-align: center; } .print-check { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; } -.print-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: var(--control-height); align-items: center; gap: 8px; margin: 12px 0 0 calc(4em + 8px); } +.print-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(90px, 1fr); grid-auto-rows: var(--control-height); align-items: center; gap: 8px; margin-top: 12px; } .print-options label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; } .print-check input, .print-options input { margin: 0; accent-color: var(--accent); } -.print-dialog .form-actions { grid-template-columns: minmax(0, 1fr) 80px 80px; margin-top: 12px; } -.print-dialog .form-actions > .form-status { overflow-wrap: anywhere; } -.print-dialog .form-actions > .form-status:empty { display: none; } -.print-dialog .form-actions > button:first-of-type { grid-column: 2; } - -.print-preview { - display: flex; - min-width: 0; - min-height: 300px; - flex-direction: column; - gap: 8px; -} +.print-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; margin-top: 12px; } +.print-footer > .form-status { min-width: 0; margin: 0; overflow-wrap: anywhere; } +.print-dialog .form-actions { grid-template-columns: 80px 80px; margin: 0; } .print-preview-page { display: grid; - height: min(62dvh, 660px); - min-height: 240px; - justify-items: center; - align-items: start; + min-width: 0; + height: 100%; + min-height: 0; + justify-items: safe center; + align-items: safe center; padding: 12px; overflow: auto; background: #e1e6e9; @@ -99,13 +93,14 @@ #ofdgoPrintDocument { display: none; } @media (max-width: 680px) { - .print-content { grid-template-columns: minmax(0, 1fr); } + .print-content { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; } .print-settings { max-height: 34dvh; } .print-preview-page { height: 32dvh; min-height: 160px; } - .print-preview { min-height: 210px; } + .print-footer { grid-template-columns: minmax(0, 1fr); gap: 8px; } + .print-footer > .form-status:empty { display: none; } + .print-preview-tools { gap: 5px; } + .print-dialog .print-preview-tools input { width: 42px; } .print-dialog .form-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } - .print-dialog .form-actions > .form-status { grid-column: 1 / -1; } - .print-dialog .form-actions > button:first-of-type { grid-column: 1; } } @media print { diff --git a/assets/webui/ofdgo_print.js b/assets/webui/ofdgo_print.js index 4803a99..f952aaa 100644 --- a/assets/webui/ofdgo_print.js +++ b/assets/webui/ofdgo_print.js @@ -72,7 +72,6 @@ export class PrintDialog { if (browser.disabled) this.el.Printer.value = "pdf"; try { if (this.nativeHost) { - browser.textContent = "系统打印"; const capabilities = await this.nativeHost.call("print.capabilities", {}); if (!this.current(sequence)) return; this.capabilities = capabilities; @@ -233,7 +232,7 @@ export class PrintDialog { if (!this.current(sequence)) return; this.profile = profile; const options = this.options(profile); - this.el.Status.textContent = "正在准备打印"; + this.el.Status.textContent = "准备打印…"; const layout = await context.call(this.prepared ? "ofdgoLayoutPrint" : "ofdgoPreparePrint", options); if (!this.current(sequence)) return; this.prepared = true; @@ -331,7 +330,7 @@ export class PrintDialog { this.root.append(style); for (let i = 0; i < this.layout.sides.length; i++) { if (!this.current(sequence)) throw new DOMException("打印已取消", "AbortError"); - this.el.Status.textContent = `正在准备纸面 ${i + 1}/${this.layout.sides.length}`; + this.el.Status.textContent = `准备纸面 ${i + 1}/${this.layout.sides.length}`; const {svg} = await context.call("ofdgoPrintSide", i); if (!this.current(sequence)) throw new DOMException("打印已取消", "AbortError"); const url = URL.createObjectURL(new Blob([svg], {type:"image/svg+xml"})); @@ -350,7 +349,7 @@ export class PrintDialog { document.title = context.name; this.waiting = this.nativeHost ? "native" : "browser"; this.controls(); - this.el.Status.textContent = job.deviceOptions ? "正在提交打印作业" : "正在打开打印窗口"; + this.el.Status.textContent = job.deviceOptions ? "提交打印…" : "打开打印…"; if (job.deviceOptions) { const result = await this.nativeHost.call("print", {...job.deviceOptions, fingerprint:job.fingerprint}); if (this.current(sequence)) { @@ -398,7 +397,7 @@ export class PrintDialog { const sequence = this.sequence, context = this.context; this.running = true; this.controls(); - this.el.Status.textContent = "正在生成打印PDF"; + this.el.Status.textContent = "生成文件…"; try { const result = await context.call("ofdgoPrintPDF"); if (this.current(sequence)) {