mathnode: increased decimal places

Also includes general improvements to the slider widget such as an optional
"autotrim" function to cut off trailing zeroes, a "format" string that's easier
to internationalize, and general tidiness.
This commit is contained in:
itsmattkc
2020-04-22 17:49:32 +10:00
parent 0f825cbc44
commit db117e0780
7 changed files with 90 additions and 39 deletions
@@ -662,6 +662,18 @@ void NodeParamViewWidgetBridge::PropertyChanged(const QString &key, const QVaria
foreach (QWidget* w, widgets_) {
static_cast<FloatSlider*>(w)->SetDisplayType(display_type);
}
} else if (key == QStringLiteral("decimalplaces")) {
int dec_places = value.toInt();
foreach (QWidget* w, widgets_) {
static_cast<FloatSlider*>(w)->SetDecimalPlaces(dec_places);
}
} else if (key == QStringLiteral("autotrim")) {
bool autotrim = value.toBool();
foreach (QWidget* w, widgets_) {
static_cast<FloatSlider*>(w)->SetAutoTrimDecimalPlaces(autotrim);
}
}
}
}