From f2d17774e8c9154f80b98f797e3561ee2ad36061 Mon Sep 17 00:00:00 2001 From: donovaly Date: Fri, 25 Dec 2020 04:02:30 +0100 Subject: [PATCH] [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 --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 1 + src/Mod/Sketcher/Gui/EditDatumDialog.cpp | 1 + src/Mod/Sketcher/Gui/InsertDatum.ui | 9 +++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 289791edbd..778688c29d 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -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; diff --git a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp index 21ba1729bf..e85e0d8bbc 100644 --- a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp +++ b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp @@ -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")); diff --git a/src/Mod/Sketcher/Gui/InsertDatum.ui b/src/Mod/Sketcher/Gui/InsertDatum.ui index 52e6baae3a..fa0ee8964a 100644 --- a/src/Mod/Sketcher/Gui/InsertDatum.ui +++ b/src/Mod/Sketcher/Gui/InsertDatum.ui @@ -33,7 +33,7 @@ - + 0 @@ -94,8 +94,13 @@ - Gui::PrefQuantitySpinBox + Gui::QuantitySpinBox QWidget +
Gui/QuantitySpinBox.h
+
+ + Gui::PrefQuantitySpinBox + Gui::QuantitySpinBox
Gui/PrefWidgets.h
showFormulaDialog(bool)