Let table cells manage widget sizes naturally

- Remove fixed heights, let Qt size widgets to fit cells
- Increase row height to 40px for more room
- Use padding instead of fixed size on remove button

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

View File

@ -299,27 +299,24 @@ 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, 32) self.assertions_table.setRowHeight(row, 40)
# Type dropdown # Type dropdown
type_combo = QComboBox() type_combo = QComboBox()
type_combo.setFixedHeight(26)
type_combo.setMinimumWidth(120) type_combo.setMinimumWidth(120)
self.assertions_table.setCellWidget(row, 0, type_combo)
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)
idx = type_combo.count() - 1 idx = type_combo.count() - 1
type_combo.setItemData(idx, tooltip, Qt.ToolTipRole) type_combo.setItemData(idx, tooltip, Qt.ToolTipRole)
self.assertions_table.setCellWidget(row, 0, type_combo)
# 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.setFixedHeight(26)
self.assertions_table.setCellWidget(row, 1, value_edit) self.assertions_table.setCellWidget(row, 1, value_edit)
# Remove button - red X for clear delete action # Remove button - red X for clear delete action
btn_remove = QPushButton("") btn_remove = QPushButton("")
btn_remove.setFixedSize(26, 26)
btn_remove.setToolTip("Remove this assertion") btn_remove.setToolTip("Remove this assertion")
btn_remove.setStyleSheet(""" btn_remove.setStyleSheet("""
QPushButton { QPushButton {
@ -328,7 +325,8 @@ class TestStepDialog(QDialog):
border: 1px solid #fc8181; border: 1px solid #fc8181;
border-radius: 4px; border-radius: 4px;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 16px;
padding: 4px 8px;
} }
QPushButton:hover { QPushButton:hover {
background-color: #feb2b2; background-color: #feb2b2;