Best-efforts resize row heights on open
This commit is contained in:
parent
74bdbe2975
commit
2432039b72
@ -593,7 +593,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
playlist_id=playlist.id,
|
||||
)
|
||||
idx = self.tabPlaylist.addTab(playlist_tab, playlist.name)
|
||||
self.tabPlaylist.setCurrentIndex(idx)
|
||||
|
||||
return idx
|
||||
|
||||
@ -1009,9 +1008,11 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
dlg.exec()
|
||||
playlist = dlg.playlist
|
||||
if playlist:
|
||||
self.create_playlist_tab(playlist)
|
||||
idx = self.create_playlist_tab(playlist)
|
||||
playlist.mark_open()
|
||||
|
||||
self.tabPlaylist.setCurrentIndex(idx)
|
||||
|
||||
def paste_rows(self) -> None:
|
||||
"""
|
||||
Paste earlier cut rows.
|
||||
|
||||
@ -204,7 +204,12 @@ class PlaylistTab(QTableView):
|
||||
if isinstance(h_header, QHeaderView):
|
||||
h_header.sectionResized.connect(self._column_resize)
|
||||
h_header.setStretchLastSection(True)
|
||||
QTimer.singleShot(0, lambda: self.resizeRowsToContents())
|
||||
# Setting ResizeToContents causes screen flash on load
|
||||
# v_header = self.verticalHeader()
|
||||
# if v_header:
|
||||
# print("HEADER")
|
||||
# v_header.setSectionResizeMode(QHeaderView.ResizeMode.ResizeToContents)
|
||||
QTimer.singleShot(300, self.resizeRowsToContents)
|
||||
|
||||
# ########## Overridden class functions ##########
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user