From 1e9a390ae2a286f75997dd2f85416b1ec54e91b7 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Fri, 19 May 2023 16:17:49 +0200 Subject: [PATCH] attempt to distinguish general and set-specifi parameter --- src/gui_qt/fit/fit_parameter.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui_qt/fit/fit_parameter.py b/src/gui_qt/fit/fit_parameter.py index 69b7301..fb36072 100644 --- a/src/gui_qt/fit/fit_parameter.py +++ b/src/gui_qt/fit/fit_parameter.py @@ -181,6 +181,7 @@ class QFitParameterWidget(QtWidgets.QWidget, Ui_FormFit): for i, value in enumerate(self.data_values[sid]): w = self.data_parameter[i] w.blockSignals(True) + w.show_as_local_parameter(value is not None) if value is None: w.value = self.glob_values[i] else: @@ -293,6 +294,7 @@ class ParameterSingleWidget(QtWidgets.QWidget): self._name = name self.label.setText(convert(name)) + self.label.setToolTip('IIf this is bold then this parameter is only for this data. otherwise the general parameter is used and displayed') self.value_line.setValidator(QtGui.QDoubleValidator()) self.value_line.textChanged.connect(lambda: self.valueChanged.emit(self.value) if self.value is not None else 0) @@ -309,10 +311,12 @@ class ParameterSingleWidget(QtWidgets.QWidget): layout.addSpacerItem(QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)) self.value_line = QtWidgets.QLineEdit(self) + self.value_line.textEdited.connect(lambda x: self.show_as_local_parameter(True)) layout.addWidget(self.value_line) self.reset_button = QtWidgets.QToolButton(self) self.reset_button.setText('Use global') + self.reset_button.clicked.connect(lambda: self.show_as_local_parameter(False)) layout.addWidget(self.reset_button) self.setLayout(layout) @@ -327,3 +331,9 @@ class ParameterSingleWidget(QtWidgets.QWidget): @value.setter def value(self, val): self.value_line.setText(f'{float(val):.5g}') + + def show_as_local_parameter(self, is_local): + if is_local: + self.label.setStyleSheet('font-weight: bold;') + else: + self.label.setStyleSheet('')