mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-18 08:29:53 +01:00
Fix for row highlighting on Windows
This commit is contained in:
parent
abe12c5d13
commit
8e6dec746d
1 changed files with 6 additions and 0 deletions
|
|
@ -80,6 +80,7 @@ class TranscriptionSegmentsEditorWidget(QTableView):
|
|||
):
|
||||
super().__init__(parent)
|
||||
|
||||
self._last_highlighted_row = -1
|
||||
self.translator = translator
|
||||
self.translator.translation.connect(self.update_translation)
|
||||
|
||||
|
|
@ -186,6 +187,11 @@ class TranscriptionSegmentsEditorWidget(QTableView):
|
|||
def highlight_and_scroll_to_row(self, row_index: int):
|
||||
"""Highlight a specific row and scroll it into view"""
|
||||
if 0 <= row_index < self.model().rowCount():
|
||||
# Only set focus if we're actually moving to a different row to avoid audio crackling
|
||||
if self._last_highlighted_row != row_index:
|
||||
self.setFocus()
|
||||
self._last_highlighted_row = row_index
|
||||
|
||||
# Select the row
|
||||
self.selectRow(row_index)
|
||||
# Scroll to the row with better positioning
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue