From 2f0c01601db647f15838b7a480341ce8f0ba879b Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Sun, 22 Dec 2024 20:52:49 +0100 Subject: [PATCH] Added library template. --- wobuzz/ui/library.py | 20 ++++++++++++++++++++ wobuzz/ui/library_dock.py | 13 +++++++++++++ wobuzz/ui/main_container.py | 14 +++++++++++--- 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 wobuzz/ui/library.py create mode 100644 wobuzz/ui/library_dock.py diff --git a/wobuzz/ui/library.py b/wobuzz/ui/library.py new file mode 100644 index 0000000..ef6c1d9 --- /dev/null +++ b/wobuzz/ui/library.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +from PyQt6.QtWidgets import QToolBox, QLabel + + +class Library(QToolBox): + def __init__(self, parent=None): + super().__init__(parent) + + label = QLabel() + self.addItem(label, "Playlists") + label = QLabel() + self.addItem(label, "Genres") + label = QLabel() + self.addItem(label, "Albums") + label = QLabel() + self.addItem(label, "Artists") + label = QLabel() + self.addItem(label, "Tracks") + diff --git a/wobuzz/ui/library_dock.py b/wobuzz/ui/library_dock.py new file mode 100644 index 0000000..ab73324 --- /dev/null +++ b/wobuzz/ui/library_dock.py @@ -0,0 +1,13 @@ +#!/usr/bin/python3 + +from PyQt6.QtWidgets import QDockWidget, QHBoxLayout +from.library import Library + + +class LibraryDock(QDockWidget): + def __init__(self, parent=None): + super().__init__(parent) + + self.library = Library(self) + self.setWidget(self.library) + diff --git a/wobuzz/ui/main_container.py b/wobuzz/ui/main_container.py index f41f36b..87cdc6f 100644 --- a/wobuzz/ui/main_container.py +++ b/wobuzz/ui/main_container.py @@ -1,7 +1,8 @@ #!/usr/bin/python3 -from PyQt6.QtWidgets import QWidget, QGridLayout -from ui.track_control import TrackControl +from PyQt6.QtWidgets import QWidget, QFrame, QGridLayout +from .track_control import TrackControl +from .library_dock import LibraryDock class MainContainer(QWidget): @@ -9,9 +10,16 @@ class MainContainer(QWidget): super().__init__(parent) self.layout = QGridLayout() + self.setLayout(self.layout) self.track_control = TrackControl(self) self.layout.addWidget(self.track_control) - self.setLayout(self.layout) + self.track_control_separator_line = QFrame() + self.track_control_separator_line.setFrameShape(QFrame.Shape.HLine) + self.track_control_separator_line.setFrameShadow(QFrame.Shadow.Sunken) + self.layout.addWidget(self.track_control_separator_line) + + self.library_dock = LibraryDock(self) + self.layout.addWidget(self.library_dock)