Pull playlist changes from v2_editor
- minimum row height - intelligent row resizing
This commit is contained in:
parent
958edb0140
commit
6ede0ab7ea
@ -57,6 +57,7 @@ from models import (
|
|||||||
|
|
||||||
start_time_re = re.compile(r"@\d\d:\d\d:\d\d")
|
start_time_re = re.compile(r"@\d\d:\d\d:\d\d")
|
||||||
HEADER_NOTES_COLUMN = 2
|
HEADER_NOTES_COLUMN = 2
|
||||||
|
MINIMUM_ROW_HEIGHT = 30
|
||||||
|
|
||||||
|
|
||||||
class RowMeta:
|
class RowMeta:
|
||||||
@ -149,6 +150,8 @@ class PlaylistTab(QTableWidget):
|
|||||||
[a.heading for a in list(sorted(columns.values(),
|
[a.heading for a in list(sorted(columns.values(),
|
||||||
key=lambda item: item.idx))]
|
key=lambda item: item.idx))]
|
||||||
)
|
)
|
||||||
|
self.horizontalHeader().sectionResized.connect(
|
||||||
|
self.resizeRowsToContents)
|
||||||
|
|
||||||
self.setAcceptDrops(True)
|
self.setAcceptDrops(True)
|
||||||
self.viewport().setAcceptDrops(True)
|
self.viewport().setAcceptDrops(True)
|
||||||
@ -1021,9 +1024,6 @@ class PlaylistTab(QTableWidget):
|
|||||||
(self.item(row, columns['row_notes'].idx)
|
(self.item(row, columns['row_notes'].idx)
|
||||||
.setBackground(QColor(note_colour)))
|
.setBackground(QColor(note_colour)))
|
||||||
|
|
||||||
# Ensure content is visible by wrapping cells
|
|
||||||
self.resizeRowToContents(row)
|
|
||||||
|
|
||||||
# Highlight low bitrates
|
# Highlight low bitrates
|
||||||
if track.bitrate:
|
if track.bitrate:
|
||||||
if track.bitrate < Config.BITRATE_LOW_THRESHOLD:
|
if track.bitrate < Config.BITRATE_LOW_THRESHOLD:
|
||||||
@ -1125,8 +1125,6 @@ class PlaylistTab(QTableWidget):
|
|||||||
self._set_row_colour(row, QColor(note_colour))
|
self._set_row_colour(row, QColor(note_colour))
|
||||||
# Section headers are always bold
|
# Section headers are always bold
|
||||||
self._set_row_bold(row)
|
self._set_row_bold(row)
|
||||||
# Ensure content is visible by wrapping cells
|
|
||||||
self.resizeRowToContents(row)
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Have we had a section start but not end?
|
# Have we had a section start but not end?
|
||||||
@ -1136,10 +1134,12 @@ class PlaylistTab(QTableWidget):
|
|||||||
self._get_section_timing_string(section_time, no_end=True)
|
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
|
# Scroll to put next track Config.SCROLL_TOP_MARGIN from the
|
||||||
# top. Rows number from zero, so set (current_row -
|
# top. Rows number from zero, so set (current_row -
|
||||||
# Config.SCROLL_TOP_MARGIN + 1) row to be top row
|
# Config.SCROLL_TOP_MARGIN + 1) row to be top row
|
||||||
|
|
||||||
if next_row is not None:
|
if next_row is not None:
|
||||||
top_row = max(0, next_row - Config.SCROLL_TOP_MARGIN + 1)
|
top_row = max(0, next_row - Config.SCROLL_TOP_MARGIN + 1)
|
||||||
scroll_item = self.item(top_row, 0)
|
scroll_item = self.item(top_row, 0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user