feat: print name in output filename; export panel trim; queue template fix
- Output filename now includes the print: <garment>_<print>.<ext>, e.g. 1_TY030.png (folder grouping unchanged) (§17.12). - Hide the single-export button (export via the queue) and remove the orphaned static export hint label (§17.13). - Fix: selecting a non-fine-tuned queue item now lays the print out per the selected template (apply_current) instead of load_print's centred default; still guarded by _loading_queue_item so it isn't marked 已微调 (§17.14). Docs: PRD 6.6/6.8/9, UI design 7.6/7.7/10/12.4, tasks.md 17.12–17.14. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -325,11 +325,8 @@ class MainWindow(QMainWindow):
|
||||
self.image_canvas.load_print(print_path)
|
||||
self.export_panel.set_garment(garment_path)
|
||||
self.export_panel.set_print(print_path)
|
||||
# If the item already has a fine-tuned transform, restore it
|
||||
if item.transform:
|
||||
self.image_canvas.set_transform(item.transform)
|
||||
self.transform_panel.set_transform(item.transform)
|
||||
# Keep template panel garment and print size in sync
|
||||
# Keep template panel garment and print size in sync first, so
|
||||
# apply_current() below can compute the template layout.
|
||||
try:
|
||||
from PIL import Image as _PilImage
|
||||
with _PilImage.open(garment_path) as img:
|
||||
@@ -338,6 +335,13 @@ class MainWindow(QMainWindow):
|
||||
self.template_panel.set_print_size(img.width, img.height)
|
||||
except Exception:
|
||||
pass
|
||||
# Fine-tuned item: restore its own transform. Otherwise lay the print
|
||||
# out per the selected template instead of load_print's default.
|
||||
if item.transform:
|
||||
self.image_canvas.set_transform(item.transform)
|
||||
self.transform_panel.set_transform(item.transform)
|
||||
else:
|
||||
self.template_panel.apply_current()
|
||||
finally:
|
||||
self._loading_queue_item = False
|
||||
self._update_reset_availability()
|
||||
|
||||
@@ -58,7 +58,6 @@ class ExportPanel(QWidget):
|
||||
|
||||
body_col.addLayout(self._make_dir_row())
|
||||
body_col.addLayout(self._make_format_form())
|
||||
body_col.addWidget(self._make_hint_label())
|
||||
body_col.addWidget(self._make_export_btn())
|
||||
|
||||
col.addWidget(body)
|
||||
@@ -108,16 +107,11 @@ class ExportPanel(QWidget):
|
||||
row.addWidget(self._quality_combo, 1)
|
||||
return row
|
||||
|
||||
def _make_hint_label(self) -> QLabel:
|
||||
self._hint_lbl = QLabel("加载衣服和印花图片后即可导出。")
|
||||
self._hint_lbl.setObjectName("exportHint")
|
||||
self._hint_lbl.setWordWrap(True)
|
||||
return self._hint_lbl
|
||||
|
||||
def _make_export_btn(self) -> QPushButton:
|
||||
self._export_btn = QPushButton("导出当前单张")
|
||||
self._export_btn.setObjectName("exportPrimaryBtn")
|
||||
self._export_btn.setEnabled(False)
|
||||
self._export_btn.setVisible(False) # hidden: export via the queue
|
||||
self._export_btn.clicked.connect(self._do_export)
|
||||
return self._export_btn
|
||||
|
||||
@@ -137,10 +131,6 @@ class ExportPanel(QWidget):
|
||||
"""Store current print transform (used on export)."""
|
||||
self._transform = state
|
||||
|
||||
def set_hint(self, text: str):
|
||||
"""Update the operation-scope hint label."""
|
||||
self._hint_lbl.setText(text)
|
||||
|
||||
def current_options(self) -> ExportOptions:
|
||||
"""Build ExportOptions from the current output settings."""
|
||||
fmt = self._format_combo.currentData()
|
||||
@@ -256,14 +246,6 @@ class ExportPanel(QWidget):
|
||||
border-radius: 3px;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
#exportHint {
|
||||
font-size: 11px;
|
||||
color: #777777;
|
||||
background: #fffbe6;
|
||||
border: 1px solid #ffe58f;
|
||||
border-radius: 3px;
|
||||
padding: 4px 6px;
|
||||
}
|
||||
#exportPrimaryBtn {
|
||||
font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
|
||||
font-size: 13px;
|
||||
|
||||
Reference in New Issue
Block a user