Finally prettified the pulse paramter options dialog for numeric options.

This commit is contained in:
jupfi 2024-01-03 12:52:23 +01:00
parent c98df42cf8
commit 3ca5526701

View file

@ -383,8 +383,14 @@ class OptionsDialog(QDialog):
self.layout = QVBoxLayout(self) self.layout = QVBoxLayout(self)
numeric_layout = QFormLayout()
numeric_layout.setHorizontalSpacing(30)
self.label = QLabel("Change options for the pulse parameter: %s" % parameter) self.label = QLabel("Change options for the pulse parameter: %s" % parameter)
self.layout.addWidget(self.label) self.layout.addWidget(self.label)
self.layout.addLayout(numeric_layout)
parameter = event.parameters[parameter] parameter = event.parameters[parameter]
options = parameter.get_options() options = parameter.get_options()
@ -409,13 +415,10 @@ class OptionsDialog(QDialog):
# If the options are a float/int we will create a QSpinBox # If the options are a float/int we will create a QSpinBox
elif isinstance(option, NumericOption): elif isinstance(option, NumericOption):
numeric_layout = QHBoxLayout()
numeric_label = QLabel(option.name) numeric_label = QLabel(option.name)
numeric_lineedit = QLineEdit(str(option.value)) numeric_lineedit = QLineEdit(str(option.value))
numeric_layout.addWidget(numeric_label) numeric_lineedit.setMaximumWidth(300)
numeric_layout.addWidget(numeric_lineedit) numeric_layout.addRow(numeric_label, numeric_lineedit)
numeric_layout.addStretch(1)
self.layout.addLayout(numeric_layout)
self.return_functions[option] = numeric_lineedit.text self.return_functions[option] = numeric_lineedit.text