From adf6e6d31e94df1a6d071e63d4ee2672587f69a1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 12 Jul 2021 22:35:14 +0200 Subject: [PATCH] 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 --- profile-widget/profilewidget2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 5f4d158d8..a10b817a2 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -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