First upload, 18 controller version
This commit is contained in:
36
app/ui/section_panel.py
Normal file
36
app/ui/section_panel.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from app.qt_compat import QHBoxLayout, QLabel, Qt, QVBoxLayout, QWidget
|
||||
|
||||
|
||||
class SectionPanel(QWidget):
|
||||
def __init__(self, title: str, parent: QWidget | None = None) -> None:
|
||||
super().__init__(parent)
|
||||
self.setObjectName("sectionPanel")
|
||||
|
||||
layout = QVBoxLayout(self)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.setSpacing(0)
|
||||
|
||||
self.header_widget = QWidget(self)
|
||||
self.header_widget.setObjectName("sectionHeader")
|
||||
self.header_widget.setFixedHeight(40)
|
||||
header_layout = QHBoxLayout(self.header_widget)
|
||||
header_layout.setContentsMargins(12, 0, 12, 0)
|
||||
header_layout.setSpacing(0)
|
||||
|
||||
self.title_label = QLabel(self.header_widget)
|
||||
self.title_label.setObjectName("sectionHeaderLabel")
|
||||
self.title_label.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
header_layout.addWidget(self.title_label, 1)
|
||||
|
||||
self.body = QWidget(self)
|
||||
self.body.setObjectName("sectionBody")
|
||||
|
||||
layout.addWidget(self.header_widget)
|
||||
layout.addWidget(self.body)
|
||||
|
||||
self.setTitle(title)
|
||||
|
||||
def setTitle(self, title: str) -> None:
|
||||
self.title_label.setText(title)
|
||||
Reference in New Issue
Block a user