From cdb9e1fb59d8605a13bcdb1b49d1f7ff3fae128e Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Sun, 4 Sep 2022 21:25:18 +0100 Subject: [PATCH] Enforce minimum row height; adjust height more intelligently --- app/playlists.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/playlists.py b/app/playlists.py index 8e1d626..059e51b 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -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