Fix assertion row alignment and improve delete button visibility

- Set consistent fixed height (26px) on all row widgets
- Replace × with ✕ and style as red delete button
- Add hover/pressed states and tooltip
- Reduce row height to 32px for tighter alignment

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rob 2026-01-17 14:13:43 -04:00
parent 7516a9b5ed
commit 0e1a5b5f62
1 changed files with 24 additions and 6 deletions

View File

@ -299,11 +299,11 @@ class TestStepDialog(QDialog):
self.assertions_table.insertRow(row) self.assertions_table.insertRow(row)
# Set proper row height for widgets # Set proper row height for widgets
self.assertions_table.setRowHeight(row, 36) self.assertions_table.setRowHeight(row, 32)
# Type dropdown # Type dropdown
type_combo = QComboBox() type_combo = QComboBox()
type_combo.setMinimumHeight(28) type_combo.setFixedHeight(26)
type_combo.setMinimumWidth(120) type_combo.setMinimumWidth(120)
for type_id, display_name, tooltip in self.ASSERTION_TYPES: for type_id, display_name, tooltip in self.ASSERTION_TYPES:
type_combo.addItem(display_name, type_id) type_combo.addItem(display_name, type_id)
@ -314,12 +314,30 @@ class TestStepDialog(QDialog):
# Value input # Value input
value_edit = QLineEdit() value_edit = QLineEdit()
value_edit.setPlaceholderText("Expected value (if applicable)") value_edit.setPlaceholderText("Expected value (if applicable)")
value_edit.setMinimumHeight(28) value_edit.setFixedHeight(26)
self.assertions_table.setCellWidget(row, 1, value_edit) self.assertions_table.setCellWidget(row, 1, value_edit)
# Remove button # Remove button - red X for clear delete action
btn_remove = QPushButton("×") btn_remove = QPushButton("")
btn_remove.setFixedWidth(30) btn_remove.setFixedSize(26, 26)
btn_remove.setToolTip("Remove this assertion")
btn_remove.setStyleSheet("""
QPushButton {
background-color: #fed7d7;
color: #c53030;
border: 1px solid #fc8181;
border-radius: 4px;
font-weight: bold;
font-size: 14px;
}
QPushButton:hover {
background-color: #feb2b2;
border-color: #f56565;
}
QPushButton:pressed {
background-color: #fc8181;
}
""")
btn_remove.clicked.connect(lambda: self._remove_assertion_row(row)) btn_remove.clicked.connect(lambda: self._remove_assertion_row(row))
self.assertions_table.setCellWidget(row, 2, btn_remove) self.assertions_table.setCellWidget(row, 2, btn_remove)