forked from Wobbl/Wobuzz
Improved settings layout.
This commit is contained in:
parent
83744eb3f4
commit
53c6bccfe6
4 changed files with 102 additions and 13 deletions
31
wobuzz/ui/settings/category.py
Normal file
31
wobuzz/ui/settings/category.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from PyQt6.QtWidgets import QWidget, QScrollArea, QVBoxLayout
|
||||
|
||||
|
||||
class Category(QWidget):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.layout = QVBoxLayout(self)
|
||||
self.setLayout(self.layout)
|
||||
|
||||
self.scroll_area = QScrollArea(self)
|
||||
self.scroll_area.setWidgetResizable(True)
|
||||
|
||||
self.settings_container = QWidget(self.scroll_area)
|
||||
self.settings_layout = QVBoxLayout(self.settings_container)
|
||||
|
||||
# spacer widget to create a sort of list where the subcategory-spacing doesn't depend on the window height
|
||||
spacer_widget = QWidget(self)
|
||||
|
||||
self.settings_layout.addWidget(spacer_widget)
|
||||
|
||||
self.settings_container.setLayout(self.settings_layout)
|
||||
|
||||
self.scroll_area.setWidget(self.settings_container)
|
||||
|
||||
self.layout.addWidget(self.scroll_area)
|
||||
|
||||
def add_sub_category(self, sub_category):
|
||||
self.settings_layout.insertWidget(self.settings_layout.count() - 1, sub_category)
|
Loading…
Add table
Add a link
Reference in a new issue