Deduplicate code creating widgets for prefs tabs
This commit is contained in:
@@ -29,4 +29,29 @@ class PreferencesSectionUI(QtWidgets.QWidget):
|
||||
for group in self.groups:
|
||||
groupoptions = group.option_dict()
|
||||
result.update(groupoptions)
|
||||
return result
|
||||
return result
|
||||
|
||||
def build_tab(self):
|
||||
tab = QtWidgets.QWidget()
|
||||
|
||||
tab_lay = QtWidgets.QVBoxLayout()
|
||||
tab_lay.setContentsMargins(2, 2, 2, 2)
|
||||
tab.setLayout(tab_lay)
|
||||
|
||||
# Not sure what the point of this is ???
|
||||
hlay1 = QtWidgets.QHBoxLayout()
|
||||
hlay1.addStretch()
|
||||
tab_lay.addLayout(hlay1)
|
||||
|
||||
scroll_area = QtWidgets.QScrollArea()
|
||||
scroll_area.setWidget(self)
|
||||
self.show()
|
||||
tab_lay.addWidget(scroll_area)
|
||||
|
||||
return tab
|
||||
|
||||
def get_tab_id(self) -> str:
|
||||
raise NotImplementedError
|
||||
|
||||
def get_tab_label(self) -> str:
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user