Close tab works
This commit is contained in:
parent
066b20a571
commit
63acc025f9
@ -198,7 +198,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
# self.btnHidePlayed.clicked.connect(self.hide_played)
|
||||
self.btnFade.clicked.connect(self.fade)
|
||||
self.btnStop.clicked.connect(self.stop)
|
||||
# self.tabPlaylist.tabCloseRequested.connect(self.close_tab)
|
||||
self.tabPlaylist.tabCloseRequested.connect(self.close_tab)
|
||||
# self.txtSearch.returnPressed.connect(self.search_playlist_return)
|
||||
# self.txtSearch.textChanged.connect(self.search_playlist_update)
|
||||
#
|
||||
@ -219,10 +219,16 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
|
||||
def close_playlist_tab(self) -> None:
|
||||
"""
|
||||
Close active playlist tab unless it holds the curren or next track.
|
||||
Close active playlist tab, called by menu item
|
||||
"""
|
||||
|
||||
tab_index = self.tabPlaylist.currentIndex()
|
||||
self.close_tab(self.tabPlaylist.currentIndex())
|
||||
|
||||
def close_tab(self, tab_index: int) -> None:
|
||||
"""
|
||||
Close active playlist tab unless it holds the curren or next track.
|
||||
Called from close_playlist_tab() or by clicking close button on tab.
|
||||
"""
|
||||
|
||||
# Don't close current track playlist
|
||||
if self.tabPlaylist.widget(tab_index) == (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user