Skip to content

Commit

Permalink
Fix for row height on long transcriptions with a lot of rows
Browse files Browse the repository at this point in the history
  • Loading branch information
raivisdejus committed Oct 25, 2024
1 parent 5ff9694 commit d306cad
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def __init__(
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()

Expand All @@ -133,7 +134,9 @@ def __init__(
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:
Expand Down

0 comments on commit d306cad

Please sign in to comment.