[Sketch] fix SnellsLaw dialog

- add missing class to UI file (found and automatically added by Qt Designer)
- add more sensible stepsize - you are dealing in practice with rations in the range 1.2 - 1.6 thus a stepsize of 1.0 is not helpful
This commit is contained in:
donovaly
2020-12-25 04:02:30 +01:00
committed by wwmayer
parent 7bd39f6a33
commit afa6866007
3 changed files with 9 additions and 2 deletions

View File

@@ -6976,6 +6976,7 @@ void CmdSketcherConstrainSnellsLaw::activated(int iMsg)
ui_Datum.labelEdit->setParamGrpPath(QByteArray("User parameter:BaseApp/History/SketcherRefrIndexRatio"));
ui_Datum.labelEdit->setToLastUsedValue();
ui_Datum.labelEdit->selectNumber();
ui_Datum.labelEdit->setSingleStep(0.05);
// Unable to bind, because the constraint does not yet exist
if (dlg.exec() != QDialog::Accepted) return;

View File

@@ -119,6 +119,7 @@ void EditDatumDialog::exec(bool atCursor)
dlg.setWindowTitle(tr("Refractive index ratio", "Constraint_SnellsLaw"));
ui_ins_datum->label->setText(tr("Ratio n2/n1:", "Constraint_SnellsLaw"));
ui_ins_datum->labelEdit->setParamGrpPath(QByteArray("User parameter:BaseApp/History/SketcherRefrIndexRatio"));
ui_ins_datum->labelEdit->setSingleStep(0.05);
}
else {
dlg.setWindowTitle(tr("Insert length"));

View File

@@ -33,7 +33,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefQuantitySpinBox" name="labelEdit" native="true">
<widget class="Gui::PrefQuantitySpinBox" name="labelEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -94,8 +94,13 @@
</widget>
<customwidgets>
<customwidget>
<class>Gui::PrefQuantitySpinBox</class>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefQuantitySpinBox</class>
<extends>Gui::QuantitySpinBox</extends>
<header>Gui/PrefWidgets.h</header>
<slots>
<signal>showFormulaDialog(bool)</signal>