diff --git a/src/agenda/agenda.cpp b/src/agenda/agenda.cpp --- a/src/agenda/agenda.cpp +++ b/src/agenda/agenda.cpp @@ -1660,23 +1660,20 @@ } } + // 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);