Deduplicate code creating widgets for prefs tabs

This commit is contained in:
David Robertson
2020-05-06 03:02:23 +01:00
parent 1fc076b158
commit f05540a587
11 changed files with 81 additions and 117 deletions

View File

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