From 8c82a1cb986334e56f817770d0397d144b92bad1 Mon Sep 17 00:00:00 2001 From: Fabio Rueda Date: Sun, 15 Sep 2019 10:16:07 +0200 Subject: if only one dive, max depth show in average field Signed-off-by: Fabio Rueda --- desktop-widgets/tab-widgets/TabDiveStatistics.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp index 0cf3befd2..9807b2a46 100644 --- a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp +++ b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp @@ -47,13 +47,14 @@ void TabDiveStatistics::updateData() stats_t stats_selection; calculate_stats_selected(&stats_selection); clear(); - ui->depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, true)); if (amount_selected > 1) { + ui->depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, true)); ui->depthLimits->setMinimum(get_depth_string(stats_selection.min_depth, true)); ui->depthLimits->setAverage(get_depth_string(stats_selection.combined_max_depth.mm / stats_selection.selection_size, true)); } else { + ui->depthLimits->setMaximum(""); ui->depthLimits->setMinimum(""); - ui->depthLimits->setAverage(""); + ui->depthLimits->setAverage(get_depth_string(stats_selection.max_depth, true)); } if (stats_selection.max_sac.mliter && (stats_selection.max_sac.mliter != stats_selection.avg_sac.mliter)) -- cgit v1.2.3-70-g09d2