Make rows tall enough for notes, notes not bold

This commit is contained in:
Keith Edmunds 2022-08-16 10:46:42 +01:00
parent 88d0c11cbc
commit c4be0b55d4

View File

@ -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: