Moved playlist tabs related widgets to its own files.
This commit is contained in:
parent
9d844ae2dd
commit
649ad1d647
5 changed files with 97 additions and 78 deletions
30
wobuzz/ui/playlist_tabs/tab_widget.py
Normal file
30
wobuzz/ui/playlist_tabs/tab_widget.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtWidgets import QTabWidget, QTabBar
|
||||
|
||||
from .tab_bar import PlaylistTabBar
|
||||
from .tab_title import TabTitle
|
||||
|
||||
|
||||
class PlaylistTabs(QTabWidget):
|
||||
def __init__(self, library, parent=None):
|
||||
self.library = library
|
||||
|
||||
super().__init__(parent)
|
||||
|
||||
self.tab_bar = PlaylistTabBar(self)
|
||||
self.setTabBar(self.tab_bar)
|
||||
self.setDocumentMode(True)
|
||||
|
||||
self.setMovable(True)
|
||||
self.setAcceptDrops(True)
|
||||
|
||||
def addTab(self, widget, label):
|
||||
super().addTab(widget, None)
|
||||
|
||||
index = self.tab_bar.count() - 1
|
||||
|
||||
title = TabTitle(label, self.tab_bar, index)
|
||||
|
||||
self.tab_bar.setTabButton(index, QTabBar.ButtonPosition.RightSide, title)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue