Commit e031408f authored by Allen Winter's avatar Allen Winter
Browse files

agenda/agenda.cpp - grid colors when not using system settings

this addresses https://bugs.kde.org/show_bug.cgi?id=411608
which refers to a much older KOrganizer version 5.9.2.

Newer KOrganizer handles grid color (computed from the
windowtext) just fine when using system settings; but,
not when using customer background colors.  With this
patch we fix that.

The bug report requested a custom configuration for the
grid color.  The UX team doesn't want that and requested
to remove the ability for custom colors completely.
That's a different thread and a different fight.

BUG: 411608
FIXED-IN 5.12.3

Differential Revision: https://phabricator.kde.org/D411608
parent 0a0f4c85
......@@ -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 halfHourPen;
if (!d->preferences()->useSystemColor()) {
hourPen = d->preferences()->agendaGridBackgroundColor().darker(150);
halfHourPen = d->preferences()->agendaGridBackgroundColor().darker(125);
const QColor windowTextColor = palette().color(QPalette::WindowText);
if (windowTextColor.red() + windowTextColor.green() + windowTextColor.blue() < (256 / 2 * 3)) {
// dark grey line
hourPen = windowTextColor.lighter(200);
halfHourPen = windowTextColor.lighter(500);
} else {
const QColor windowTextColor = palette().color(QPalette::WindowText);
if (windowTextColor.red() + windowTextColor.green() + windowTextColor.blue() < (256 / 2 * 3)) {
// dark grey line
hourPen = windowTextColor.lighter(200);
halfHourPen = windowTextColor.lighter(500);
} else {
// light grey line
hourPen = windowTextColor.darker(150);
halfHourPen = windowTextColor.darker(200);
}
// light grey line
hourPen = windowTextColor.darker(150);
halfHourPen = windowTextColor.darker(200);
}
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