From 4974579e73bd49dc23b2b55adce02b0f1b20afb2 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 30 Jul 2021 23:50:03 -0400 Subject: [PATCH] "bracket"-ify fills bar + labels and try to evenly space the pane sections --- piker/ui/_forms.py | 138 ++++++++++++++++++++++++++------------------- 1 file changed, 80 insertions(+), 58 deletions(-) diff --git a/piker/ui/_forms.py b/piker/ui/_forms.py index c63bccc0..c784c3ca 100644 --- a/piker/ui/_forms.py +++ b/piker/ui/_forms.py @@ -155,6 +155,10 @@ class FontScaledDelegate(QStyledItemDelegate): class FieldsForm(QWidget): + godwidget: 'GodWidget' # noqa + vbox: QVBoxLayout + form: QFormLayout + def __init__( self, @@ -172,41 +176,46 @@ class FieldsForm(QWidget): QSizePolicy.Expanding, ) + # XXX: not sure why we have to create this here exactly + # (instead of in the pane creation routine) but it's + # here and is managed by downstream layout routines. + # best guess is that you have to create layouts in order + # of hierarchy in order for things to display correctly? + # TODO: we may want to hand this *down* from some "pane manager" + # thing eventually? self.vbox = QVBoxLayout(self) - self.vbox.setAlignment(Qt.AlignTop) - self.vbox.setContentsMargins(0, 4, 4, 4) + self.vbox.setAlignment(Qt.AlignVCenter) + self.vbox.setContentsMargins(0, 4, 3, 6) self.vbox.setSpacing(0) # split layout for the (