First pass at adding B&W support for daily report printing.

This commit is contained in:
sawinglogz 2020-07-18 14:56:00 -04:00
parent 5765da4096
commit a339b4679d
3 changed files with 34 additions and 8 deletions

View File

@ -1,6 +1,7 @@
/* gFlagsLine Implementation
/* gFlagsLine Implementation
*
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
* Copyright (c) 2020 The OSCAR Team
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of the source code
@ -176,8 +177,14 @@ void gFlagsGroup::paint(QPainter &painter, gGraph &g, const QRegion &region)
for (int i=0, end=visflags.size(); i < end; i++) {
// Alternating box color
if (i & 1) { barcol = COLOR_ALT_BG1; }
else { barcol = COLOR_ALT_BG2; }
barcol = COLOR_ALT_BG2;
if (i & 1) {
if (g.printing() && AppSetting->monochromePrinting()) {
barcol = QColor(0xe4, 0xe4, 0xe4, 0xff);
} else {
barcol = COLOR_ALT_BG1;
}
}
painter.fillRect(left, floor(linetop), width-1, ceil(m_barh), QBrush(barcol));
@ -294,6 +301,9 @@ void gFlagsLine::paint(QPainter &painter, gGraph &w, const QRegion &region)
QVector<QLine> vlines;
QColor color=schema::channel[m_code].defaultColor();
if (w.printing() && AppSetting->monochromePrinting()) {
color = Qt::black;
}
QBrush brush(color);
int tooltipTimeout = AppSetting->tooltipTimeout();
@ -415,7 +425,11 @@ void gFlagsLine::paint(QPainter &painter, gGraph &w, const QRegion &region)
}
}
if (w.printing() && AppSetting->monochromePrinting()) {
painter.setPen(QPen(Qt::black, 1.5));
} else {
painter.setPen(color);
}
painter.drawLines(vlines);
}

View File

@ -839,7 +839,11 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion &region)
}
}
if (w.printing() && AppSetting->monochromePrinting()) {
painter.setPen(QPen(Qt::black, lineThickness + 0.5));
} else {
painter.setPen(QPen(chan.defaultColor(), lineThickness));
}
painter.drawLines(lines);
w.graphView()->lines_drawn_this_frame += lines.count();
lines.clear();
@ -962,7 +966,11 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion &region)
}
}
}
if (w.printing() && AppSetting->monochromePrinting()) {
painter.setPen(QPen(Qt::black, lineThickness + 0.5));
} else {
painter.setPen(QPen(chan.defaultColor(), lineThickness));
}
painter.drawLines(lines);
w.graphView()->lines_drawn_this_frame+=lines.count();
lines.clear();

View File

@ -1,6 +1,7 @@
/* gSegmentChart Implementation
/* gSegmentChart Implementation
*
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
* Copyright (c) 2020 The OSCAR Team
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of the source code
@ -125,7 +126,10 @@ void gSegmentChart::paint(QPainter &painter, gGraph &w, const QRegion &region)
// Pie Chart
/////////////////////////////////////////////////////////////////////////////////////
if (m_graph_type == GST_Pie) {
const QColor col = schema::channel[m_codes[m]].defaultColor();
QColor col = schema::channel[m_codes[m]].defaultColor();
if (w.printing() && AppSetting->monochromePrinting()) {
col = Qt::white;
}
// length of this segment in degrees
float len = 360.0 / m_total * data;