feat: template delete, whole-reset relocation, and compact param/export rows

- Template delete: add a 删除 button (reuses template_service.delete_template)
  with a confirm dialog; hidden for built-ins like 保存; reloads and re-selects
  the first built-in after deletion, persisting the new selection.
- Whole reset: move the template-wide reset out of the template area to the
  bottom of the transform panel and rename it to 位置尺寸旋转重置为当前模板, so it
  sits with the params it resets, beside the three per-section resets.
- Compact layout: pair X/Y and 宽/高 onto single rows (short labels), and put
  the export 格式/质量 selectors on one row. Sync logic unchanged.

Docs: PRD 6.6, UI design 7.1/7.2/7.3/7.4/7.5/10, tasks.md 17.4/17.5/17.6.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-16 17:45:09 +08:00
co-authored by Claude Opus 4.8
parent f767ec2660
commit 7fe770e80d
7 changed files with 223 additions and 56 deletions
+9 -8
View File
@@ -6,7 +6,6 @@ from PySide6.QtCore import Qt
from PySide6.QtWidgets import (
QComboBox,
QFileDialog,
QFormLayout,
QHBoxLayout,
QLabel,
QLineEdit,
@@ -77,17 +76,15 @@ class ExportPanel(QWidget):
row.addWidget(browse_btn)
return row
def _make_format_form(self) -> QFormLayout:
form = QFormLayout()
form.setSpacing(6)
form.setLabelAlignment(Qt.AlignRight | Qt.AlignVCenter)
def _make_format_form(self) -> QHBoxLayout:
row = QHBoxLayout()
row.setSpacing(6)
self._format_combo = QComboBox()
self._format_combo.setObjectName("exportCombo")
self._format_combo.addItem("PNG", "PNG")
self._format_combo.addItem("JPG", "JPG")
self._format_combo.currentIndexChanged.connect(self._on_format_changed)
form.addRow("格式", self._format_combo)
self._quality_combo = QComboBox()
self._quality_combo.setObjectName("exportCombo")
@@ -95,9 +92,13 @@ class ExportPanel(QWidget):
self._quality_combo.addItem(label, val)
self._quality_combo.setCurrentIndex(1) # default: 高 (90)
self._quality_combo.setEnabled(False) # enabled only for JPG
form.addRow("质量", self._quality_combo)
return form
# 格式 and 质量 share one row (quality lights up only for JPG)
row.addWidget(QLabel("格式"))
row.addWidget(self._format_combo, 1)
row.addWidget(QLabel("质量"))
row.addWidget(self._quality_combo, 1)
return row
def _make_hint_label(self) -> QLabel:
self._hint_lbl = QLabel("加载衣服和印花图片后即可导出。")