better VisualStyleOverheadThreshold

This commit is contained in:
royjr
2025-10-08 21:28:10 -04:00
parent 3ff2e9b26a
commit b85b8ffacf
@@ -218,15 +218,12 @@ VisualsPanel::VisualsPanel(QWidget *parent) : QWidget(parent) {
"VisualStyleOverheadThreshold", tr("Visual Style Overhead Threshold"),
tr("Sets the speed (in mph) where the display transitions between normal and overhead view."),
"", {10, 80}, 5, false, nullptr, false);
connect(visual_style_overhead_threshold_settings, &OptionControlSP::updateLabels, [=]() {
int value = QString::fromStdString(params.get("VisualStyleOverheadThreshold")).toInt();
visual_style_overhead_threshold_settings->setLabel(QString::number(value) + " mph");
});
int value = QString::fromStdString(params.get("VisualStyleOverheadThreshold")).toInt();
visual_style_overhead_threshold_settings->setLabel(QString::number(value) + " mph");
auto updateThresholdLabel = [=]() {
int mph = QString::fromStdString(params.get("VisualStyleOverheadThreshold")).toInt();
visual_style_overhead_threshold_settings->setLabel(QString("%1 mph").arg(mph));
};
connect(visual_style_overhead_threshold_settings, &OptionControlSP::updateLabels, updateThresholdLabel);
updateThresholdLabel();
list->addItem(visual_style_overhead_threshold_settings);
// Visuals: Display Metrics below Chevron