diff --git a/sleepyhead/Graphs/gLineChart.cpp b/sleepyhead/Graphs/gLineChart.cpp
index f0df316b..34b2a688 100644
--- a/sleepyhead/Graphs/gLineChart.cpp
+++ b/sleepyhead/Graphs/gLineChart.cpp
@@ -660,7 +660,7 @@ void gLineChart::paint(QPainter &painter, gGraph &w, int left, int top, int widt
if (done) { break; }
}
}
- painter.setPen(QPen(m_colors[gi],1));
+ painter.setPen(QPen(m_colors[gi],p_profile->appearance->lineThickness()));
painter.drawLines(lines);
w.graphView()->lines_drawn_this_frame+=lines.count();
lines.clear();
@@ -760,7 +760,7 @@ void AHIChart::paint(QPainter &painter, gGraph &w, int left, int top, int width,
double top1 = top + height;
bool done = false;
- painter.setPen(QPen(m_color,1.5));
+ painter.setPen(QPen(m_color,p_profile->appearance->lineThickness()));
painter.setClipRect(left, top, width, height);
painter.setClipping(true);
diff --git a/sleepyhead/Graphs/gSummaryChart.cpp b/sleepyhead/Graphs/gSummaryChart.cpp
index d6a856a7..3349821f 100644
--- a/sleepyhead/Graphs/gSummaryChart.cpp
+++ b/sleepyhead/Graphs/gSummaryChart.cpp
@@ -567,7 +567,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, int left, int top, int wi
}
QColor col1 = col;
- QColor col2 = brighten(col);
+ QColor col2 = Qt::white;
//outlines->setColor(Qt::black);
int np = d.value().size();
@@ -587,7 +587,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, int left, int top, int wi
//tmp-=miny;
h = tmp * ymult;
- QLinearGradient gradient(QPoint(0,0),QPoint(barw,0));
+ QLinearGradient gradient(x1, py-h, x1+barw, py-h);
gradient.setColorAt(0,col1);
gradient.setColorAt(1,col2);
painter.fillRect(x1, py-h, barw, h, QBrush(gradient));
@@ -683,9 +683,9 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, int left, int top, int wi
if (graphtype == GT_BAR) {
QColor col1 = col;
- QColor col2 = brighten(col);
+ QColor col2 = Qt::white;
- QLinearGradient gradient(0,0,barw,h);
+ QLinearGradient gradient(x1, py-h, x1+barw, py-h);
gradient.setColorAt(0,col1);
gradient.setColorAt(1,col2);
painter.fillRect(x1, py-h, barw, h, QBrush(gradient));
@@ -740,15 +740,15 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, int left, int top, int wi
}
if (zd == hl_day) {
- painter.setPen(QPen(col2,10));
+ painter.setPen(QPen(brighten(col2),10));
painter.drawPoint(px2 - barw / 2, py2);
}
if (lastdaygood) {
- painter.setPen(QPen(col2,1));
+ painter.setPen(QPen(col2,p_profile->appearance->lineThickness()));
painter.drawLine(lastX[j] - barw / 2, lastY[j], px2 - barw / 2, py2);
} else {
- painter.setPen(QPen(col1,1));
+ painter.setPen(QPen(col1,p_profile->appearance->lineThickness()));
painter.drawLine(px + barw / 2 - 1, py2, px + barw / 2 + 1, py2);
}
diff --git a/sleepyhead/SleepLib/profiles.h b/sleepyhead/SleepLib/profiles.h
index cad18a71..b01126a7 100644
--- a/sleepyhead/SleepLib/profiles.h
+++ b/sleepyhead/SleepLib/profiles.h
@@ -244,6 +244,7 @@ const QString STR_AS_OverviewLinechartMode = "OverviewLinechartMode";
const QString STR_AS_UsePixmapCaching = "UsePixmapCaching";
const QString STR_AS_AllowYAxisScaling = "AllowYAxisScaling";
const QString STR_AS_GraphTooltips = "GraphTooltips";
+const QString STR_AS_LineThickness = "LineThickness";
// UserSettings Strings
const QString STR_US_UnitSystem = "UnitSystem";
@@ -568,6 +569,7 @@ class AppearanceSettings : public ProfileSettings
initPref(STR_AS_UsePixmapCaching, true);
initPref(STR_AS_OverlayType, ODT_Bars);
initPref(STR_AS_OverviewLinechartMode, OLC_Bartop);
+ initPref(STR_AS_LineThickness, 1.0);
}
//! \brief Returns the normal (unscaled) height of a graph
@@ -586,6 +588,10 @@ class AppearanceSettings : public ProfileSettings
bool allowYAxisScaling() const { return getPref(STR_AS_AllowYAxisScaling).toBool(); }
//! \brief Whether to show graph tooltips
bool graphTooltips() const { return getPref(STR_AS_GraphTooltips).toBool(); }
+ //! \brief Pen width of line plots
+ float lineThickness() const { return getPref(STR_AS_LineThickness).toFloat(); }
+
+
//! \brief Returns the type of overlay flags (which are displayed over the Flow Waveform)
OverlayDisplayType overlayType() const {
return (OverlayDisplayType)getPref(STR_AS_OverlayType).toInt();
@@ -617,6 +623,8 @@ class AppearanceSettings : public ProfileSettings
void setOverviewLinechartMode(OverviewLinechartModes od) {
setPref(STR_AS_OverviewLinechartMode, (int)od);
}
+ //! \brief Set the pen width of line plots.
+ void setLineThickness(float size) { setPref(STR_AS_LineThickness, size); }
};
/*! \class UserSettings
diff --git a/sleepyhead/preferencesdialog.cpp b/sleepyhead/preferencesdialog.cpp
index 4dc54088..1923d0c7 100644
--- a/sleepyhead/preferencesdialog.cpp
+++ b/sleepyhead/preferencesdialog.cpp
@@ -156,6 +156,8 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
ui->bigFontBold->setChecked(bigfont->weight() == QFont::Bold);
ui->bigFontItalic->setChecked(bigfont->italic());
+ ui->lineThicknessSlider->setValue(profile->appearance->lineThickness()*2);
+
ui->startedUsingMask->setDate(profile->cpap->maskStartDate());
ui->leakModeCombo->setCurrentIndex(profile->cpap->leakMode());
@@ -388,6 +390,8 @@ bool PreferencesDialog::Save()
profile->appearance->setUsePixmapCaching(ui->usePixmapCaching->isChecked());
profile->appearance->setSquareWavePlots(ui->useSquareWavePlots->isChecked());
profile->appearance->setGraphSnapshots(ui->enableGraphSnapshots->isChecked());
+ profile->appearance->setLineThickness(float(ui->lineThicknessSlider->value()) / 2.0);
+
profile->general->setSkipEmptyDays(ui->skipEmptyDays->isChecked());
profile->general->setTooltipTimeout(ui->tooltipTimeoutSlider->value() * 50);
diff --git a/sleepyhead/preferencesdialog.ui b/sleepyhead/preferencesdialog.ui
index 12576249..d237c7ac 100644
--- a/sleepyhead/preferencesdialog.ui
+++ b/sleepyhead/preferencesdialog.ui
@@ -10,7 +10,7 @@
0
0
721
- 572
+ 610
@@ -51,7 +51,7 @@
-
- 5
+ 6
@@ -1882,7 +1882,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
Qt::Vertical
@@ -1895,7 +1895,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
-
@@ -1943,7 +1943,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
-
@@ -1991,7 +1991,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
Scroll Dampening
@@ -2001,7 +2001,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
Tooltip Timeout
@@ -2093,6 +2093,42 @@ p, li { white-space: pre-wrap; }
+ -
+
+
+ Line Thickness
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
-
+
+
+ The pixel thickness of line plots
+
+
+ 2
+
+
+ 8
+
+
+ 1
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksBelow
+
+
+
+
+
@@ -2175,8 +2211,7 @@ this application to be unstable with this feature enabled.
-
- Turn on/off the spinning "context" cube.
-It really doesn't use that much resources.. :)
+ <html><head/><body><p>These features have recently been pruned. They will come back later. </p></body></html>
Animations && Fancy Stuff