fix: Ctrl-deselecting scan result jumps to previous selected row
When the current item is deselected via Ctrl+click, fall back to the last remaining selected item instead of staying on the deselected row. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -973,9 +973,16 @@ class ScanResultsPanel(QWidget):
|
||||
return ""
|
||||
|
||||
def _on_selection_changed(self, table: QTableWidget) -> None:
|
||||
selected = table.selectedItems()
|
||||
cur = table.currentItem()
|
||||
if cur is not None:
|
||||
start = table.item(cur.row(), 0).data(Qt.ItemDataRole.UserRole + 1)
|
||||
# If current item was deselected, fall back to last selected row
|
||||
if cur is not None and cur.isSelected():
|
||||
row = cur.row()
|
||||
elif selected:
|
||||
row = selected[-1].row()
|
||||
else:
|
||||
return
|
||||
start = table.item(row, 0).data(Qt.ItemDataRole.UserRole + 1)
|
||||
if start is not None:
|
||||
self.seek_requested.emit(float(start))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user