Commit 5c3db09d authored by Allen Winter's avatar Allen Winter
Browse files

Merge branch 'release/19.12'

parents 4f00c852 e031408f
...@@ -1660,23 +1660,20 @@ void Agenda::drawContents(QPainter *p, int cx, int cy, int cw, int ch) ...@@ -1660,23 +1660,20 @@ void Agenda::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
} }
} }
// Compute the grid line color for both the hour and half-hour
// The grid colors are always computed as a function of the palette's windowText color.
QPen hourPen; QPen hourPen;
QPen halfHourPen; QPen halfHourPen;
if (!d->preferences()->useSystemColor()) { const QColor windowTextColor = palette().color(QPalette::WindowText);
hourPen = d->preferences()->agendaGridBackgroundColor().darker(150); if (windowTextColor.red() + windowTextColor.green() + windowTextColor.blue() < (256 / 2 * 3)) {
halfHourPen = d->preferences()->agendaGridBackgroundColor().darker(125); // dark grey line
hourPen = windowTextColor.lighter(200);
halfHourPen = windowTextColor.lighter(500);
} else { } else {
const QColor windowTextColor = palette().color(QPalette::WindowText); // light grey line
if (windowTextColor.red() + windowTextColor.green() + windowTextColor.blue() < (256 / 2 * 3)) { hourPen = windowTextColor.darker(150);
// dark grey line halfHourPen = windowTextColor.darker(200);
hourPen = windowTextColor.lighter(200);
halfHourPen = windowTextColor.lighter(500);
} else {
// light grey line
hourPen = windowTextColor.darker(150);
halfHourPen = windowTextColor.darker(200);
}
} }
dbp.setPen(hourPen); dbp.setPen(hourPen);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment