profile: update visibility on replot

Currently, setting the visibility of chart features is a mess. It
is done when switching to the profile state and then via signals,
when the preferences are changed.

However, when the preferences are changed the chart is replot anyway.
So let us simply set the visibility on chart replot. Then in
a follow-up commit, the signals can be removed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-07-12 22:35:14 +02:00 committed by Dirk Hohndel
parent cab179601f
commit adf6e6d31e

View file

@ -546,6 +546,7 @@ void ProfileWidget2::plotDive(const struct dive *dIn, int dcIn, bool doClearPict
#endif
if (currentState == EMPTY)
setProfileState();
updateVisibility();
bool setpointflag = (currentdc->divemode == CCR) && prefs.pp_graphs.po2;
bool sensorflag = setpointflag && prefs.show_ccr_sensors;
@ -1170,7 +1171,6 @@ void ProfileWidget2::setProfileState()
mouseFollowerVertical->setVisible(false);
#endif
hideAll(gases);
updateVisibility();
}
#ifndef SUBSURFACE_MOBILE