diff --git a/wobuzz/ui/library.py b/wobuzz/ui/library.py index ef6c1d9..c1eb17d 100644 --- a/wobuzz/ui/library.py +++ b/wobuzz/ui/library.py @@ -1,12 +1,15 @@ #!/usr/bin/python3 -from PyQt6.QtWidgets import QToolBox, QLabel +from PyQt6.QtWidgets import QToolBox, QLabel, QFrame class Library(QToolBox): def __init__(self, parent=None): super().__init__(parent) + self.setFrameShape(QFrame.Shape.Box) + self.setFrameShadow(QFrame.Shadow.Sunken) + label = QLabel() self.addItem(label, "Playlists") label = QLabel() diff --git a/wobuzz/ui/library_dock.py b/wobuzz/ui/library_dock.py index ab73324..2bb768d 100644 --- a/wobuzz/ui/library_dock.py +++ b/wobuzz/ui/library_dock.py @@ -1,13 +1,20 @@ #!/usr/bin/python3 -from PyQt6.QtWidgets import QDockWidget, QHBoxLayout -from.library import Library +from PyQt6.QtCore import Qt +from PyQt6.QtWidgets import QDockWidget +from .library import Library class LibraryDock(QDockWidget): def __init__(self, parent=None): super().__init__(parent) + self.setAllowedAreas( + Qt.DockWidgetArea.LeftDockWidgetArea | + Qt.DockWidgetArea.RightDockWidgetArea | + Qt.DockWidgetArea.BottomDockWidgetArea + ) + self.library = Library(self) self.setWidget(self.library) diff --git a/wobuzz/ui/lines.py b/wobuzz/ui/lines.py new file mode 100644 index 0000000..7299976 --- /dev/null +++ b/wobuzz/ui/lines.py @@ -0,0 +1,11 @@ +#!/usr/bin/python3 + +from PyQt6.QtWidgets import QFrame + + +class HLine(QFrame): + def __init__(self, parent=None): + super().__init__(parent) + + self.setFrameShape(QFrame.Shape.HLine) + self.setFrameShadow(QFrame.Shadow.Sunken) \ No newline at end of file diff --git a/wobuzz/ui/main_container.py b/wobuzz/ui/main_container.py index 87cdc6f..c0df367 100644 --- a/wobuzz/ui/main_container.py +++ b/wobuzz/ui/main_container.py @@ -1,8 +1,8 @@ #!/usr/bin/python3 -from PyQt6.QtWidgets import QWidget, QFrame, QGridLayout +from PyQt6.QtWidgets import QWidget, QFrame, QDockWidget, QGridLayout from .track_control import TrackControl -from .library_dock import LibraryDock +from .lines import HLine class MainContainer(QWidget): @@ -12,14 +12,10 @@ class MainContainer(QWidget): self.layout = QGridLayout() self.setLayout(self.layout) + self.layout.addWidget(HLine(self)) + self.track_control = TrackControl(self) self.layout.addWidget(self.track_control) - 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) + self.layout.addWidget(HLine(self)) diff --git a/wobuzz/ui/main_window.py b/wobuzz/ui/main_window.py index c279ec3..34058f9 100644 --- a/wobuzz/ui/main_window.py +++ b/wobuzz/ui/main_window.py @@ -1,7 +1,9 @@ #!/usr/bin/python3 -from PyQt6.QtWidgets import QMainWindow, QMenu -from ui.main_container import MainContainer +from PyQt6.QtCore import Qt +from PyQt6.QtWidgets import QMainWindow, QMenu, QDockWidget +from .main_container import MainContainer +from .library_dock import LibraryDock class MainWindow(QMainWindow): @@ -14,6 +16,12 @@ class MainWindow(QMainWindow): self.menu_bar.addMenu(QMenu("&File", self)) self.main_container = MainContainer(self) - self.setCentralWidget(self.main_container) + self.library_dock = LibraryDock() + self.library_dock.setFeatures( + QDockWidget.DockWidgetFeature.DockWidgetMovable | + QDockWidget.DockWidgetFeature.DockWidgetFloatable + ) + self.addDockWidget(Qt.DockWidgetArea.BottomDockWidgetArea, self.library_dock) +