mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-03-05 00:12:49 +01:00
feat(scan control): wrap metadata form in a group box for better organization
This commit is contained in:
@@ -9,6 +9,7 @@ from qtpy.QtGui import QColor
|
||||
from qtpy.QtWidgets import (
|
||||
QApplication,
|
||||
QComboBox,
|
||||
QGroupBox,
|
||||
QHBoxLayout,
|
||||
QLabel,
|
||||
QPushButton,
|
||||
@@ -171,7 +172,13 @@ class ScanControl(BECWidget, QWidget):
|
||||
self.layout.addStretch()
|
||||
|
||||
def _add_metadata_form(self):
|
||||
self.layout.addWidget(self._metadata_form)
|
||||
# Wrap metadata form in a group box
|
||||
self._metadata_group = QGroupBox("Scan Metadata", self)
|
||||
self._metadata_group.setSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed)
|
||||
metadata_layout = QVBoxLayout(self._metadata_group)
|
||||
metadata_layout.addWidget(self._metadata_form)
|
||||
|
||||
self.layout.addWidget(self._metadata_group)
|
||||
self._metadata_form.update_with_new_scan(self.comboBox_scan_selection.currentText())
|
||||
self.scan_selected.connect(self._metadata_form.update_with_new_scan)
|
||||
self._metadata_form.form_data_updated.connect(self.update_scan_metadata)
|
||||
|
||||
@@ -53,6 +53,8 @@ class ScanMetadata(PydanticModelForm):
|
||||
|
||||
super().__init__(parent=parent, data_model=self._md_schema, client=client, **kwargs)
|
||||
|
||||
self._layout.setContentsMargins(0, 0, 0, 0)
|
||||
self._form_grid_container.layout().setContentsMargins(0, 0, 0, 0)
|
||||
self._layout.addWidget(self._additional_md_box)
|
||||
self._additional_md_box_layout.addWidget(self._additional_metadata)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user