From c4be0b55d429ba38061be5b455554afa3d81d9d3 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Tue, 16 Aug 2022 10:46:42 +0100 Subject: [PATCH] Make rows tall enough for notes, notes not bold --- app/playlists.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/app/playlists.py b/app/playlists.py index 7f44c13..e3c8c63 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -410,6 +410,8 @@ class PlaylistTab(QTableWidget): with Session() as session: self.update_display(session) + # Adjust row heights to fit content + self.resizeRowsToContents() self.edit_cell_type = None self.musicmuster.enable_play_next_controls() @@ -1089,6 +1091,9 @@ class PlaylistTab(QTableWidget): self._get_section_timing_string(section_time, no_end=True) ) + # Ensure content is visible by wrapping cells + self.resizeRowsToContents() + # 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 @@ -1693,15 +1698,19 @@ class PlaylistTab(QTableWidget): session.commit() def _set_row_bold(self, row: int, bold: bool = True) -> None: - """Make row bold (bold=True) or not bold""" + """ + Make row bold (bold=True) or not bold. - j: int + Don't make notes column bold. + """ - boldfont: QFont = QFont() + boldfont = QFont() boldfont.setBold(bold) - for j in range(self.columnCount()): - if self.item(row, j): - self.item(row, j).setFont(boldfont) + for column in range(self.columnCount()): + if column == columns['row_notes'].idx: + continue + if self.item(row, column): + self.item(row, column).setFont(boldfont) def _set_row_colour(self, row: int, colour: Optional[QColor] = None) -> None: