mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 22:55:46 +01:00
Fix for row height on long transcriptions with a lot of rows (#960)
This commit is contained in:
parent
5ff9694b1a
commit
c94671f3d6
1 changed files with 4 additions and 1 deletions
|
|
@ -117,6 +117,7 @@ class TranscriptionSegmentsEditorWidget(QTableView):
|
|||
self.setSelectionMode(QTableView.SelectionMode.SingleSelection)
|
||||
self.selectionModel().selectionChanged.connect(self.on_selection_changed)
|
||||
model.select()
|
||||
model.rowsInserted.connect(self.init_row_height)
|
||||
|
||||
self.has_translations = self.has_non_empty_translation()
|
||||
|
||||
|
|
@ -133,7 +134,9 @@ class TranscriptionSegmentsEditorWidget(QTableView):
|
|||
def init_row_height(self):
|
||||
font_metrics = QFontMetrics(self.font())
|
||||
max_row_height = font_metrics.height() * 4
|
||||
for row in range(self.model().rowCount()):
|
||||
row_count = self.model().rowCount()
|
||||
|
||||
for row in range(row_count):
|
||||
self.setRowHeight(row, max_row_height)
|
||||
|
||||
def has_non_empty_translation(self) -> bool:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue