Added a button that adds a playlist.

This commit is contained in:
The Wobbler 2025-01-25 21:46:48 +01:00
parent 1007ac045f
commit 31e72c25d3
6 changed files with 57 additions and 9 deletions

View file

@ -1,15 +1,28 @@
#!/usr/bin/python3
from PyQt6.QtWidgets import QToolBox, QLabel, QFrame, QTabWidget
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QToolBox, QLabel, QTabWidget, QToolButton
class Library(QToolBox):
def __init__(self, parent=None):
def __init__(self, library, parent=None):
super().__init__(parent)
self.library = library
self.playlist_tabs = QTabWidget()
self.playlist_tabs.setMovable(True)
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()
@ -19,3 +32,5 @@ class Library(QToolBox):
label = QLabel()
self.addItem(label, "Tracks")
self.create_playlist.pressed.connect(self.library.new_playlist)