From 8e6dec746db148798a2443310ac4e15abd3926ab Mon Sep 17 00:00:00 2001 From: Raivis Dejus Date: Fri, 5 Sep 2025 09:50:20 +0300 Subject: [PATCH] Fix for row highlighting on Windows --- .../transcription_segments_editor_widget.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buzz/widgets/transcription_viewer/transcription_segments_editor_widget.py b/buzz/widgets/transcription_viewer/transcription_segments_editor_widget.py index b50c75ce..a9cb4896 100644 --- a/buzz/widgets/transcription_viewer/transcription_segments_editor_widget.py +++ b/buzz/widgets/transcription_viewer/transcription_segments_editor_widget.py @@ -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