From 2504965f8d767a02a79b52c7656a6a18e018a28d Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Mon, 8 Jan 2024 22:06:04 +0100 Subject: [PATCH] Add more spacing in preferences layout --- novelwriter/extensions/configlayout.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/novelwriter/extensions/configlayout.py b/novelwriter/extensions/configlayout.py index 676d055b..9cb932cd 100644 --- a/novelwriter/extensions/configlayout.py +++ b/novelwriter/extensions/configlayout.py @@ -45,6 +45,8 @@ class NScrollableForm(QScrollArea): super().__init__(parent=parent) self._helpCol = QColor(0, 0, 0) self._fontScale = FONT_SCALE + self._first = True + self._sections: dict[int, QLabel] = {} self._editable: dict[str, NHelpLabel] = {} self._index: dict[str, QWidget] = {} @@ -109,8 +111,11 @@ class NScrollableForm(QScrollArea): hM = CONFIG.pxInt(4) qLabel = QLabel(f"{label}", self) qLabel.setContentsMargins(0, hM, 0, hM) + if not self._first: + self._layout.addSpacing(5*hM) self._layout.addWidget(qLabel) self._sections[identifier] = qLabel + self._first = False return def addRow(self, label: str, widget: QWidget, helpText: str = "", unit: str | None = None, @@ -118,7 +123,7 @@ class NScrollableForm(QScrollArea): """Add a label and a widget as a new row of the form.""" row = QHBoxLayout() - wSp = CONFIG.pxInt(8) + wSp = CONFIG.pxInt(12) qLabel = QLabel(label, self) qLabel.setIndent(wSp) qLabel.setBuddy(widget) @@ -146,11 +151,13 @@ class NScrollableForm(QScrollArea): self._layout.addLayout(row) self._index[label.strip()] = widget + self._first = False return def finalise(self) -> None: """Finalise the layout when the form is built.""" + self._layout.addSpacing(CONFIG.pxInt(20)) self._layout.addStretch(1) return