diff --git a/Graphs/gLineOverlay.cpp b/Graphs/gLineOverlay.cpp index abe256be..8c29ea9b 100644 --- a/Graphs/gLineOverlay.cpp +++ b/Graphs/gLineOverlay.cpp @@ -5,6 +5,7 @@ *********************************************************************/ #include +#include "SleepLib/profiles.h" #include "gLineOverlay.h" gLineOverlayBar::gLineOverlayBar(gPointData *d,QColor col,QString _label,LO_Type _lot) @@ -102,7 +103,7 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry) vertarray[vertcnt++]=start_py+1+12; } else if (lo_type==LOT_Bar) { int z=start_py+height; - if (xx<(3600.0/86400.0)) { + if (pref["AlwaysShowOverlayBars"].toBool() || (xx<(3600.0/86400.0))) { z=top; pointarray[pointcnt++]=x1; diff --git a/mainwindow.cpp b/mainwindow.cpp index 7e3cdbd1..a3c9e59b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -82,6 +82,10 @@ MainWindow::MainWindow(QWidget *parent) : if (!pref.Exists("UseAntiAliasing")) pref["UseAntiAliasing"]=false; else ui->actionUse_AntiAliasing->setChecked(pref["UseAntiAliasing"].toBool()); first_load=true; + + if (!pref.Exists("AlwaysShowOverlayBars")) pref["AlwaysShowOverlayBars"]=true; + else ui->actionOverlay_Bars->setChecked(pref["AlwaysShowOverlayBars"].toBool()); + } MainWindow::~MainWindow() @@ -281,3 +285,9 @@ void MainWindow::on_actionDebug_toggled(bool checked) ui->logText->hide(); } } + +void MainWindow::on_actionOverlay_Bars_toggled(bool checked) +{ + pref["AlwaysShowOverlayBars"]=checked; + if (daily) daily->RedrawGraphs(); +} diff --git a/mainwindow.h b/mainwindow.h index bf4abace..736e4304 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -66,6 +66,8 @@ private slots: void on_actionDebug_toggled(bool arg1); + void on_actionOverlay_Bars_toggled(bool arg1); + private: Ui::MainWindow *ui; Daily * daily; diff --git a/mainwindow.ui b/mainwindow.ui index daa93af8..ae53f15c 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -593,6 +593,7 @@ + @@ -709,6 +710,14 @@ Debug + + + true + + + Overlay Bars + +