forked from Wobbl/Wobuzz
35 lines
959 B
Python
35 lines
959 B
Python
#!/usr/bin/python3
|
|
|
|
from PyQt6.QtGui import QIcon
|
|
from PyQt6.QtWidgets import QToolBox, QLabel, QTabWidget, QToolButton
|
|
from .playlist_tabs import PlaylistTabs
|
|
|
|
|
|
class Library(QToolBox):
|
|
def __init__(self, library, parent=None):
|
|
super().__init__(parent)
|
|
|
|
self.library = library
|
|
|
|
self.playlist_tabs = PlaylistTabs(library)
|
|
|
|
self.addItem(self.playlist_tabs, "Playlists")
|
|
|
|
self.create_playlist = QToolButton(self)
|
|
|
|
plus_icon = QIcon.fromTheme(QIcon.ThemeIcon.ListAdd)
|
|
self.create_playlist.setIcon(plus_icon)
|
|
|
|
self.playlist_tabs.setCornerWidget(self.create_playlist)
|
|
|
|
label = QLabel()
|
|
self.addItem(label, "Genres")
|
|
label = QLabel()
|
|
self.addItem(label, "Albums")
|
|
label = QLabel()
|
|
self.addItem(label, "Artists")
|
|
label = QLabel()
|
|
self.addItem(label, "Tracks")
|
|
|
|
self.create_playlist.pressed.connect(self.library.new_playlist)
|
|
|