Improved library style.
This commit is contained in:
parent
2f0c01601d
commit
368bbbe6f8
5 changed files with 40 additions and 15 deletions
|
@ -1,12 +1,15 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from PyQt6.QtWidgets import QToolBox, QLabel
|
from PyQt6.QtWidgets import QToolBox, QLabel, QFrame
|
||||||
|
|
||||||
|
|
||||||
class Library(QToolBox):
|
class Library(QToolBox):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
|
self.setFrameShape(QFrame.Shape.Box)
|
||||||
|
self.setFrameShadow(QFrame.Shadow.Sunken)
|
||||||
|
|
||||||
label = QLabel()
|
label = QLabel()
|
||||||
self.addItem(label, "Playlists")
|
self.addItem(label, "Playlists")
|
||||||
label = QLabel()
|
label = QLabel()
|
||||||
|
|
|
@ -1,13 +1,20 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from PyQt6.QtWidgets import QDockWidget, QHBoxLayout
|
from PyQt6.QtCore import Qt
|
||||||
from.library import Library
|
from PyQt6.QtWidgets import QDockWidget
|
||||||
|
from .library import Library
|
||||||
|
|
||||||
|
|
||||||
class LibraryDock(QDockWidget):
|
class LibraryDock(QDockWidget):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
|
self.setAllowedAreas(
|
||||||
|
Qt.DockWidgetArea.LeftDockWidgetArea |
|
||||||
|
Qt.DockWidgetArea.RightDockWidgetArea |
|
||||||
|
Qt.DockWidgetArea.BottomDockWidgetArea
|
||||||
|
)
|
||||||
|
|
||||||
self.library = Library(self)
|
self.library = Library(self)
|
||||||
self.setWidget(self.library)
|
self.setWidget(self.library)
|
||||||
|
|
||||||
|
|
11
wobuzz/ui/lines.py
Normal file
11
wobuzz/ui/lines.py
Normal 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)
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from PyQt6.QtWidgets import QWidget, QFrame, QGridLayout
|
from PyQt6.QtWidgets import QWidget, QFrame, QDockWidget, QGridLayout
|
||||||
from .track_control import TrackControl
|
from .track_control import TrackControl
|
||||||
from .library_dock import LibraryDock
|
from .lines import HLine
|
||||||
|
|
||||||
|
|
||||||
class MainContainer(QWidget):
|
class MainContainer(QWidget):
|
||||||
|
@ -12,14 +12,10 @@ class MainContainer(QWidget):
|
||||||
self.layout = QGridLayout()
|
self.layout = QGridLayout()
|
||||||
self.setLayout(self.layout)
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
|
self.layout.addWidget(HLine(self))
|
||||||
|
|
||||||
self.track_control = TrackControl(self)
|
self.track_control = TrackControl(self)
|
||||||
self.layout.addWidget(self.track_control)
|
self.layout.addWidget(self.track_control)
|
||||||
|
|
||||||
self.track_control_separator_line = QFrame()
|
self.layout.addWidget(HLine(self))
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from PyQt6.QtWidgets import QMainWindow, QMenu
|
from PyQt6.QtCore import Qt
|
||||||
from ui.main_container import MainContainer
|
from PyQt6.QtWidgets import QMainWindow, QMenu, QDockWidget
|
||||||
|
from .main_container import MainContainer
|
||||||
|
from .library_dock import LibraryDock
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
|
@ -14,6 +16,12 @@ class MainWindow(QMainWindow):
|
||||||
self.menu_bar.addMenu(QMenu("&File", self))
|
self.menu_bar.addMenu(QMenu("&File", self))
|
||||||
|
|
||||||
self.main_container = MainContainer(self)
|
self.main_container = MainContainer(self)
|
||||||
|
|
||||||
self.setCentralWidget(self.main_container)
|
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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue