From 0e1a5b5f621d142b65d449acd78d47c6667480a4 Mon Sep 17 00:00:00 2001 From: rob Date: Sat, 17 Jan 2026 14:13:43 -0400 Subject: [PATCH] Fix assertion row alignment and improve delete button visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/cmdforge/gui/dialogs/test_step_dialog.py | 30 ++++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/cmdforge/gui/dialogs/test_step_dialog.py b/src/cmdforge/gui/dialogs/test_step_dialog.py index d9019cd..83225c5 100644 --- a/src/cmdforge/gui/dialogs/test_step_dialog.py +++ b/src/cmdforge/gui/dialogs/test_step_dialog.py @@ -299,11 +299,11 @@ class TestStepDialog(QDialog): self.assertions_table.insertRow(row) # Set proper row height for widgets - self.assertions_table.setRowHeight(row, 36) + self.assertions_table.setRowHeight(row, 32) # Type dropdown type_combo = QComboBox() - type_combo.setMinimumHeight(28) + type_combo.setFixedHeight(26) type_combo.setMinimumWidth(120) for type_id, display_name, tooltip in self.ASSERTION_TYPES: type_combo.addItem(display_name, type_id) @@ -314,12 +314,30 @@ class TestStepDialog(QDialog): # Value input value_edit = QLineEdit() value_edit.setPlaceholderText("Expected value (if applicable)") - value_edit.setMinimumHeight(28) + value_edit.setFixedHeight(26) self.assertions_table.setCellWidget(row, 1, value_edit) - # Remove button - btn_remove = QPushButton("×") - btn_remove.setFixedWidth(30) + # Remove button - red X for clear delete action + btn_remove = QPushButton("✕") + 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)) self.assertions_table.setCellWidget(row, 2, btn_remove)