Gui: fix some issues in DlgSettingsColorGradientImp:
* fix regression by rounding Max/Min values when setting up dialog * switch signals from QLineEdit::editingFinished to QLineEdit::textEdited to get changes immediately
This commit is contained in:
@@ -93,10 +93,10 @@ void DlgSettingsColorGradientImp::setupConnections()
|
||||
connect(ui->checkBoxInvisible, &QCheckBox::toggled,
|
||||
this, &DlgSettingsColorGradientImp::colorModelChanged);
|
||||
|
||||
connect(ui->floatLineEditMax, &QLineEdit::editingFinished,
|
||||
connect(ui->floatLineEditMax, &QLineEdit::textEdited,
|
||||
this, &DlgSettingsColorGradientImp::colorModelChanged);
|
||||
|
||||
connect(ui->floatLineEditMin, &QLineEdit::editingFinished,
|
||||
connect(ui->floatLineEditMin, &QLineEdit::textEdited,
|
||||
this, &DlgSettingsColorGradientImp::colorModelChanged);
|
||||
}
|
||||
|
||||
@@ -205,9 +205,10 @@ int DlgSettingsColorGradientImp::numberOfLabels() const
|
||||
return ui->spinBoxLabel->value();
|
||||
}
|
||||
|
||||
void DlgSettingsColorGradientImp::setNumberOfDecimals(int val)
|
||||
void DlgSettingsColorGradientImp::setNumberOfDecimals(int val, float fMin, float fMax)
|
||||
{
|
||||
ui->spinBoxDecimals->setValue(val);
|
||||
setRange(fMin, fMax);
|
||||
}
|
||||
|
||||
int DlgSettingsColorGradientImp::numberOfDecimals() const
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
//@}
|
||||
/** @name Parameter range and scale */
|
||||
//@{
|
||||
void setNumberOfDecimals(int);
|
||||
void setNumberOfDecimals(int, float fMin, float fMax);
|
||||
int numberOfDecimals() const;
|
||||
//@}
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ void SoFCColorGradient::customize(SoFCColorBarBase* parentNode)
|
||||
QWidget* parent = Gui::getMainWindow()->activeWindow();
|
||||
Gui::Dialog::DlgSettingsColorGradientImp dlg(_cColGrad, parent);
|
||||
App::ColorGradientProfile profile = _cColGrad.getProfile();
|
||||
dlg.setNumberOfDecimals(_precision);
|
||||
dlg.setNumberOfDecimals(_precision, profile.fMin, profile.fMax);
|
||||
|
||||
QPoint pos(QCursor::pos());
|
||||
pos += QPoint(int(-1.1 * dlg.width()), int(-0.1 * dlg.height()));
|
||||
|
||||
Reference in New Issue
Block a user