Wobuzz/wobuzz/ui/library.py

36 lines
959 B
Python
Raw Permalink Normal View History

2024-12-22 20:52:49 +01:00
#!/usr/bin/python3
2025-01-25 21:46:48 +01:00
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QToolBox, QLabel, QTabWidget, QToolButton
from .playlist_tabs import PlaylistTabs
2024-12-22 20:52:49 +01:00
class Library(QToolBox):
2025-01-25 21:46:48 +01:00
def __init__(self, library, parent=None):
2024-12-22 20:52:49 +01:00
super().__init__(parent)
2025-01-25 21:46:48 +01:00
self.library = library
self.playlist_tabs = PlaylistTabs(library)
2025-01-25 21:46:48 +01:00
self.addItem(self.playlist_tabs, "Playlists")
2025-01-25 21:46:48 +01:00
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)
2024-12-22 20:52:49 +01:00
label = QLabel()
self.addItem(label, "Genres")
label = QLabel()
self.addItem(label, "Albums")
label = QLabel()
self.addItem(label, "Artists")
label = QLabel()
self.addItem(label, "Tracks")
2025-01-25 21:46:48 +01:00
self.create_playlist.pressed.connect(self.library.new_playlist)