Faded out detail dot of filtered chart line.

This commit is contained in:
23rd 2023-07-14 18:06:35 +03:00 committed by John Preston
parent 423d2293f9
commit 41bc47eb6f
3 changed files with 9 additions and 9 deletions

View file

@ -951,15 +951,13 @@ void ChartWidget::setupChartArea() {
QRect(bottom.x(), bottom.y(), bottom.width(), st::lineWidth), QRect(bottom.x(), bottom.y(), bottom.width(), st::lineWidth),
st::windowSubTextFg); st::windowSubTextFg);
} }
{ for (const auto &dot : detailsPaintContext.dots) {
auto o = ScopedPainterOpacity(p, detailsAlpha); p.setBrush(st::boxBg);
for (const auto &dot : detailsPaintContext.dots) { p.setPen(QPen(dot.color, st::statisticsChartLineWidth));
p.setBrush(st::boxBg); const auto r = st::statisticsDetailsDotRadius;
p.setPen(QPen(dot.color, st::statisticsChartLineWidth)); auto hq = PainterHighQualityEnabler(p);
const auto r = st::statisticsDetailsDotRadius; auto o = ScopedPainterOpacity(p, dot.alpha * detailsAlpha);
auto hq = PainterHighQualityEnabler(p); p.drawEllipse(dot.point, r, r);
p.drawEllipse(dot.point, r, r);
}
} }
p.setPen(st::windowSubTextFg); p.setPen(st::windowSubTextFg);

View file

@ -60,6 +60,7 @@ void PaintLinearChartView(
detailsPaintContext.dots.push_back({ detailsPaintContext.dots.push_back({
QPointF(xPoint, yPoint), QPointF(xPoint, yPoint),
line.color, line.color,
p.opacity(),
}); });
} }
if (first) { if (first) {

View file

@ -21,6 +21,7 @@ struct DetailsPaintContext final {
struct Dot { struct Dot {
QPointF point; QPointF point;
QColor color; QColor color;
float64 alpha = 0.;
}; };
std::vector<Dot> dots; std::vector<Dot> dots;
}; };