Clean up playlists.py
This commit is contained in:
parent
076451ff89
commit
b15687a4c6
@ -207,11 +207,14 @@ class PlaylistTab(QTableView):
|
|||||||
self.setDragDropMode(QAbstractItemView.DragDropMode.InternalMove)
|
self.setDragDropMode(QAbstractItemView.DragDropMode.InternalMove)
|
||||||
self.setDragDropOverwriteMode(False)
|
self.setDragDropOverwriteMode(False)
|
||||||
self.setAcceptDrops(True)
|
self.setAcceptDrops(True)
|
||||||
|
|
||||||
# Set our custom style - this draws the drop indicator across the whole row
|
# Set our custom style - this draws the drop indicator across the whole row
|
||||||
self.setStyle(PlaylistStyle())
|
self.setStyle(PlaylistStyle())
|
||||||
|
|
||||||
# We will enable dragging when rows are selected. Disabling it
|
# We will enable dragging when rows are selected. Disabling it
|
||||||
# here means we can click and drag to select rows.
|
# here means we can click and drag to select rows.
|
||||||
self.setDragEnabled(False)
|
self.setDragEnabled(False)
|
||||||
|
|
||||||
# Prepare for context menu
|
# Prepare for context menu
|
||||||
self.menu = QMenu()
|
self.menu = QMenu()
|
||||||
self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||||
@ -229,12 +232,14 @@ class PlaylistTab(QTableView):
|
|||||||
# Load playlist rows
|
# Load playlist rows
|
||||||
self.setModel(self.proxy_model)
|
self.setModel(self.proxy_model)
|
||||||
self._set_column_widths()
|
self._set_column_widths()
|
||||||
|
|
||||||
# Stretch last column *after* setting column widths which is
|
# Stretch last column *after* setting column widths which is
|
||||||
# *much* faster
|
# *much* faster
|
||||||
h_header = self.horizontalHeader()
|
h_header = self.horizontalHeader()
|
||||||
if isinstance(h_header, QHeaderView):
|
if isinstance(h_header, QHeaderView):
|
||||||
h_header.sectionResized.connect(self._column_resize)
|
h_header.sectionResized.connect(self._column_resize)
|
||||||
h_header.setStretchLastSection(True)
|
h_header.setStretchLastSection(True)
|
||||||
|
|
||||||
# Setting ResizeToContents causes screen flash on load
|
# Setting ResizeToContents causes screen flash on load
|
||||||
self.resize_rows()
|
self.resize_rows()
|
||||||
|
|
||||||
@ -920,12 +925,6 @@ class PlaylistTab(QTableView):
|
|||||||
Implement spanning of cells, initiated by signal
|
Implement spanning of cells, initiated by signal
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Commented out as too noisy
|
|
||||||
# log.debug(
|
|
||||||
# f"_span_cells({playlist_id=}, {row=}, "
|
|
||||||
# f"{column=}, {rowSpan=}, {columnSpan=}) {self.playlist_id=}"
|
|
||||||
# )
|
|
||||||
|
|
||||||
if playlist_id != self.playlist_id:
|
if playlist_id != self.playlist_id:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user