Added a custom layout for the prefs so that it adjusts to different screen sizes automatically. I may have gotten slightly carried away on this one........

This commit is contained in:
David Robertson
2020-05-09 23:29:59 +01:00
parent 13296aea1d
commit 500cc34639
2 changed files with 178 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
from typing import Dict
from PyQt5 import QtWidgets, QtCore
from PyQt5 import QtWidgets
from flatcamGUI.ColumnarFlowLayout import ColumnarFlowLayout
from flatcamGUI.preferences.OptionUI import OptionUI
from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
@@ -10,8 +10,7 @@ class PreferencesSectionUI(QtWidgets.QWidget):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.layout = QtWidgets.QHBoxLayout()
self.layout = ColumnarFlowLayout() #QtWidgets.QHBoxLayout()
self.setLayout(self.layout)
self.groups = self.build_groups()
@@ -19,7 +18,6 @@ class PreferencesSectionUI(QtWidgets.QWidget):
group.setMinimumWidth(250)
self.layout.addWidget(group)
self.layout.addStretch()
def build_groups(self) -> [OptionsGroupUI]:
return []
@@ -34,6 +32,7 @@ class PreferencesSectionUI(QtWidgets.QWidget):
def build_tab(self):
scroll_area = QtWidgets.QScrollArea()
scroll_area.setWidget(self)
scroll_area.setWidgetResizable(True)
return scroll_area
def get_tab_id(self) -> str: