Improved library style.

This commit is contained in:
The Wobbler 2024-12-22 21:20:18 +01:00
parent 2f0c01601d
commit 368bbbe6f8
5 changed files with 40 additions and 15 deletions

View file

@ -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()

View file

@ -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)

11
wobuzz/ui/lines.py Normal file
View file

@ -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)

View file

@ -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))

View file

@ -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)