feat(ai-outfit): two settings per row in the right column
Replace the one-per-row QFormLayout with a 2-column QGridLayout (3x2: 并发/间隔 · 冷却/重试 · 分辨率/质量), matching the mockup's 2-col 生成设置. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ from PySide6.QtWidgets import (
|
||||
QComboBox,
|
||||
QDoubleSpinBox,
|
||||
QFileDialog,
|
||||
QGridLayout,
|
||||
QGroupBox,
|
||||
QHBoxLayout,
|
||||
QHeaderView,
|
||||
@@ -234,14 +235,12 @@ class AiOutfitPanel(QWidget):
|
||||
return scroll
|
||||
|
||||
def _create_settings_group(self):
|
||||
"""生成设置 group (lives in the right run column)."""
|
||||
from PySide6.QtWidgets import QFormLayout
|
||||
"""生成设置 group (lives in the right run column); two params per row."""
|
||||
gen = QGroupBox("生成设置")
|
||||
gv = QVBoxLayout(gen)
|
||||
self._retry_failed_chk = QCheckBox("重试上次失败的行")
|
||||
gv.addWidget(self._retry_failed_chk)
|
||||
|
||||
form = QFormLayout()
|
||||
self._concurrency = QSpinBox()
|
||||
self._concurrency.setRange(1, 16)
|
||||
self._interval = QDoubleSpinBox()
|
||||
@@ -256,15 +255,32 @@ class AiOutfitPanel(QWidget):
|
||||
self._resolution.addItems(_RESOLUTIONS)
|
||||
self._quality = QComboBox()
|
||||
self._quality.addItems(_QUALITIES)
|
||||
form.addRow("并发数", self._concurrency)
|
||||
form.addRow("新请求间隔", self._interval)
|
||||
form.addRow("单任务冷却", self._cooldown)
|
||||
form.addRow("失败重试", self._retry_count)
|
||||
form.addRow("分辨率", self._resolution)
|
||||
form.addRow("JPG 质量", self._quality)
|
||||
gv.addLayout(form)
|
||||
|
||||
pairs = [
|
||||
("并发数", self._concurrency), ("新请求间隔", self._interval),
|
||||
("单任务冷却", self._cooldown), ("失败重试", self._retry_count),
|
||||
("分辨率", self._resolution), ("JPG 质量", self._quality),
|
||||
]
|
||||
grid = QGridLayout()
|
||||
grid.setHorizontalSpacing(10)
|
||||
grid.setVerticalSpacing(8)
|
||||
grid.setColumnStretch(0, 1)
|
||||
grid.setColumnStretch(1, 1)
|
||||
for i, (label, widget) in enumerate(pairs):
|
||||
grid.addWidget(self._field(label, widget), i // 2, i % 2)
|
||||
gv.addLayout(grid)
|
||||
return gen
|
||||
|
||||
def _field(self, label_text, widget):
|
||||
"""A compact label-above-control cell for the 2-column settings grid."""
|
||||
cell = QWidget()
|
||||
v = QVBoxLayout(cell)
|
||||
v.setContentsMargins(0, 0, 0, 0)
|
||||
v.setSpacing(2)
|
||||
v.addWidget(QLabel(label_text))
|
||||
v.addWidget(widget)
|
||||
return cell
|
||||
|
||||
def _path_row(self, line_edit, on_browse):
|
||||
row = QHBoxLayout()
|
||||
row.addWidget(line_edit, stretch=1)
|
||||
|
||||
Reference in New Issue
Block a user