步骤八页面修改
This commit is contained in:
@ -17,7 +17,7 @@ from src.gui.panels._step_path_resolver import get_step_output_path, resolve_ste
|
||||
from PyQt5.QtWidgets import (
|
||||
QWidget, QVBoxLayout, QGroupBox, QFormLayout, QGridLayout,
|
||||
QHBoxLayout, QLabel, QLineEdit, QSpinBox, QCheckBox,
|
||||
QPushButton, QFileDialog, QMessageBox,
|
||||
QPushButton, QFileDialog, QMessageBox, QSizePolicy,
|
||||
)
|
||||
from PyQt5.QtCore import Qt
|
||||
|
||||
@ -100,6 +100,14 @@ class Step8MlTrainPanel(QWidget):
|
||||
self.create_ml_page()
|
||||
layout.addWidget(self.ml_page)
|
||||
|
||||
# ==========================================
|
||||
# 卡片 3:输出与执行
|
||||
# ==========================================
|
||||
output_group = QGroupBox("🚀 输出与执行")
|
||||
output_layout = QVBoxLayout()
|
||||
output_layout.setSpacing(16)
|
||||
output_layout.setContentsMargins(20, 24, 20, 20)
|
||||
|
||||
# 输出文件路径 (改为文件夹模式)
|
||||
self.output_path = FileSelectWidget(
|
||||
"模型输出目录:",
|
||||
@ -107,18 +115,23 @@ class Step8MlTrainPanel(QWidget):
|
||||
)
|
||||
self.output_path.browse_btn.clicked.disconnect()
|
||||
self.output_path.browse_btn.clicked.connect(self.browse_output_path)
|
||||
layout.addWidget(self.output_path)
|
||||
output_layout.addWidget(self.output_path)
|
||||
|
||||
# 启用步骤
|
||||
self.enable_checkbox = QCheckBox("启用此步骤")
|
||||
self.enable_checkbox.setChecked(False)
|
||||
layout.addWidget(self.enable_checkbox)
|
||||
# 完美对齐的底部按钮栏(已彻底移除多余的启用复选框)
|
||||
action_layout = QHBoxLayout()
|
||||
action_layout.addStretch()
|
||||
|
||||
# 独立运行按钮
|
||||
self.run_btn = QPushButton("独立运行此步骤")
|
||||
self.run_btn.setStyleSheet(ModernStylesheet.get_button_stylesheet('success'))
|
||||
self.run_btn = QPushButton("独立运行步骤")
|
||||
self.run_btn.setStyleSheet(ModernStylesheet.get_button_stylesheet('primary'))
|
||||
self.run_btn.setMinimumWidth(140)
|
||||
self.run_btn.clicked.connect(self._on_run_single_clicked)
|
||||
layout.addWidget(self.run_btn)
|
||||
action_layout.addWidget(self.run_btn)
|
||||
|
||||
output_layout.addLayout(action_layout)
|
||||
output_group.setLayout(output_layout)
|
||||
|
||||
# 将打包好的输出卡片添加到主 layout 中
|
||||
layout.addWidget(output_group)
|
||||
|
||||
layout.addStretch()
|
||||
self.setLayout(layout)
|
||||
@ -167,8 +180,20 @@ class Step8MlTrainPanel(QWidget):
|
||||
preproc_grid.addWidget(checkbox, i // 4, i % 4)
|
||||
|
||||
button_layout = QHBoxLayout()
|
||||
button_layout.setContentsMargins(0, 10, 0, 0) # 顶部增加边距
|
||||
button_layout.setSpacing(10) # 按钮之间的间距
|
||||
|
||||
select_all_btn = QPushButton("全选")
|
||||
deselect_all_btn = QPushButton("全不选")
|
||||
|
||||
# 应用统一样式和自适应宽度策略
|
||||
for btn in [select_all_btn, deselect_all_btn]:
|
||||
base_style = ModernStylesheet.get_button_stylesheet('normal')
|
||||
# 增加 padding 确保文字不被截断
|
||||
btn.setStyleSheet(base_style + "\nQPushButton { padding-left: 14px; padding-right: 14px; }")
|
||||
btn.setFixedHeight(30)
|
||||
btn.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
|
||||
|
||||
select_all_btn.clicked.connect(lambda: self._toggle_checkboxes(self.preproc_checkboxes, True))
|
||||
deselect_all_btn.clicked.connect(lambda: self._toggle_checkboxes(self.preproc_checkboxes, False))
|
||||
button_layout.addWidget(select_all_btn)
|
||||
@ -216,8 +241,18 @@ class Step8MlTrainPanel(QWidget):
|
||||
row += 1
|
||||
|
||||
model_button_layout = QHBoxLayout()
|
||||
model_button_layout.setContentsMargins(0, 10, 0, 0)
|
||||
model_button_layout.setSpacing(10)
|
||||
|
||||
model_select_all = QPushButton("全选")
|
||||
model_deselect_all = QPushButton("全不选")
|
||||
|
||||
for btn in [model_select_all, model_deselect_all]:
|
||||
base_style = ModernStylesheet.get_button_stylesheet('normal')
|
||||
btn.setStyleSheet(base_style + "\nQPushButton { padding-left: 14px; padding-right: 14px; }")
|
||||
btn.setFixedHeight(30)
|
||||
btn.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
|
||||
|
||||
model_select_all.clicked.connect(lambda: self._toggle_checkboxes(self.model_checkboxes, True))
|
||||
model_deselect_all.clicked.connect(lambda: self._toggle_checkboxes(self.model_checkboxes, False))
|
||||
model_button_layout.addWidget(model_select_all)
|
||||
@ -244,8 +279,18 @@ class Step8MlTrainPanel(QWidget):
|
||||
split_grid.addWidget(checkbox, 0, i)
|
||||
|
||||
split_button_layout = QHBoxLayout()
|
||||
split_button_layout.setContentsMargins(0, 10, 0, 0)
|
||||
split_button_layout.setSpacing(10)
|
||||
|
||||
split_select_all = QPushButton("全选")
|
||||
split_deselect_all = QPushButton("全不选")
|
||||
|
||||
for btn in [split_select_all, split_deselect_all]:
|
||||
base_style = ModernStylesheet.get_button_stylesheet('normal')
|
||||
btn.setStyleSheet(base_style + "\nQPushButton { padding-left: 14px; padding-right: 14px; }")
|
||||
btn.setFixedHeight(30)
|
||||
btn.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
|
||||
|
||||
split_select_all.clicked.connect(lambda: self._toggle_checkboxes(self.split_checkboxes, True))
|
||||
split_deselect_all.clicked.connect(lambda: self._toggle_checkboxes(self.split_checkboxes, False))
|
||||
split_button_layout.addWidget(split_select_all)
|
||||
|
||||
Reference in New Issue
Block a user