mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
If no dives are selected, clear the stats widget
Previously we had lots of zeros and some non-sensical data displayed (the temp values were actually not zeroed out). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8bbe24f485
commit
75f6159a04
1 changed files with 4 additions and 0 deletions
|
@ -678,6 +678,10 @@ static void show_total_dive_stats(struct dive *dive)
|
|||
get_selected_dives_text(buffer, sizeof(buffer));
|
||||
set_label(stats_w.framelabel, "Statistics %s", buffer);
|
||||
set_label(stats_w.selection_size, "%d", stats_ptr->selection_size);
|
||||
if (stats_ptr->selection_size == 0) {
|
||||
clear_stats_widgets();
|
||||
return;
|
||||
}
|
||||
if (stats_ptr->min_temp) {
|
||||
value = get_temp_units(stats_ptr->min_temp, &unit);
|
||||
set_label(stats_w.min_temp, "%.1f %s", value, unit);
|
||||
|
|
Loading…
Reference in a new issue