Enforce minimum row height; adjust height more intelligently

This commit is contained in:
Keith Edmunds 2022-09-04 21:25:18 +01:00
parent 6ede0ab7ea
commit cdb9e1fb59

View File

@ -137,6 +137,8 @@ class PlaylistTab(QTableWidget):
self.setVerticalScrollMode(QAbstractItemView.ScrollPerPixel)
self.setRowCount(0)
self.setColumnCount(len(columns))
v_header = self.verticalHeader()
v_header.setMinimumSectionSize(MINIMUM_ROW_HEIGHT)
self.horizontalHeader().setStretchLastSection(True)
# Header row
@ -999,6 +1001,9 @@ class PlaylistTab(QTableWidget):
if not note_colour:
note_colour = Config.COLOUR_NOTES_PLAYLIST
# Set row height
self.resizeRowToContents(row)
# Get track if there is one
track_id = self._get_row_track_id(row)
track = None
@ -1134,9 +1139,6 @@ class PlaylistTab(QTableWidget):
self._get_section_timing_string(section_time, no_end=True)
)
# Ensure content is visible by wrapping cells
self.resizeRowToContents(row)
# Scroll to put next track Config.SCROLL_TOP_MARGIN from the
# top. Rows number from zero, so set (current_row -
# Config.SCROLL_TOP_MARGIN + 1) row to be top row