Commit 670c330a authored by Sandro Knauß's avatar Sandro Knauß
Browse files

QColor::dark and QColor::light are deprecated

use QColor::darker and QColor::lighter instead.
parent 70ba57fe
......@@ -1591,8 +1591,8 @@ void Agenda::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
}
}
QPen hourPen(d->preferences()->agendaGridBackgroundColor().dark(150));
QPen halfHourPen(d->preferences()->agendaGridBackgroundColor().dark(125));
QPen hourPen(d->preferences()->agendaGridBackgroundColor().darker(150));
QPen halfHourPen(d->preferences()->agendaGridBackgroundColor().darker(125));
dbp.setPen(hourPen);
// Draw vertical lines of grid, start with the last line not yet visible
......
......@@ -898,7 +898,7 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
}
if (mSelected) {
bgColor = bgColor.light(EventView::BRIGHTNESS_FACTOR);
bgColor = bgColor.lighter(EventView::BRIGHTNESS_FACTOR);
}
const QColor textColor = EventViews::getTextColor(bgColor);
......@@ -1157,7 +1157,7 @@ void AgendaItem::drawRoundedRect(QPainter *p, const QRect &rect,
QLinearGradient gradient(QPointF(r.x(), r.y()), QPointF(r.x(), r.height()));
if (selected) {
QColor top = bgColor.dark(250);
QColor top = bgColor.darker(250);
top.setAlpha(40);
gradient.setColorAt(0, top);
gradient.setColorAt(1, QColor(255, 255, 255, 30));
......@@ -1193,29 +1193,29 @@ void AgendaItem::drawRoundedRect(QPainter *p, const QRect &rect,
if (mIncidence->allDay() &&
mIncidence->dtStart() == mIncidence->dateTime(KCalCore::Incidence::RoleEnd) &&
CalendarSupport::hasEvent(mIncidence)) {
gradient.setColorAt(0, bgColor.light(130));
gradient.setColorAt(0, bgColor.lighter(130));
qreal t = 1.0 - (r.height() - 18.0) / r.height();
gradient.setColorAt(t, bgColor.light(115));
gradient.setColorAt(t, bgColor.lighter(115));
qreal b = (r.height() - 20.0) / r.height();
gradient.setColorAt(b, bgColor);
} else {
gradient.setColorAt(0, bgColor.light(115));
gradient.setColorAt(0, bgColor.lighter(115));
qreal b = (r.height() - 20.0) / r.height();
gradient.setColorAt(b, bgColor);
}
gradient.setColorAt(1, bgColor.dark(110));
gradient.setColorAt(1, bgColor.darker(110));
} else {
if (mIncidence->allDay() &&
mIncidence->dtStart() == mIncidence->dateTime(KCalCore::Incidence::RoleEnd) &&
!CalendarSupport::hasTodo(mIncidence)) {
gradient.setColorAt(0, bgColor.light(130));
gradient.setColorAt(0.35, bgColor.light(115));
gradient.setColorAt(0, bgColor.lighter(130));
gradient.setColorAt(0.35, bgColor.lighter(115));
gradient.setColorAt(0.65, bgColor);
} else {
gradient.setColorAt(0, bgColor.light(115));
gradient.setColorAt(0, bgColor.lighter(115));
gradient.setColorAt(0.65, bgColor);
}
gradient.setColorAt(1, bgColor.dark(110));
gradient.setColorAt(1, bgColor.darker(110));
}
p->setBrush(gradient);
......
......@@ -640,7 +640,7 @@ QColor EventView::itemFrameColor(const QColor &color, bool selected)
if (color.isValid()) {
return selected ? QColor(85 + color.red() * 2.0 / 3,
85 + color.green() * 2.0 / 3,
85 + color.blue() * 2.0 / 3) : color.dark(115);
85 + color.blue() * 2.0 / 3) : color.darker(115);
} else {
return Qt::black;
}
......
......@@ -247,8 +247,8 @@ void MonthGraphicsItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWi
QLinearGradient gradient(0, 0, 0, boundingRect().height());
gradient.setColorAt(0, bgColor);
gradient.setColorAt(0.7, bgColor.dark(110));
gradient.setColorAt(1, bgColor.dark(150));
gradient.setColorAt(0.7, bgColor.darker(110));
gradient.setColorAt(1, bgColor.darker(150));
QBrush brush(gradient);
p->setBrush(brush);
p->setPen(Qt::NoPen);
......
......@@ -251,14 +251,14 @@ void MonthGraphicsView::drawBackground(QPainter *p, const QRectF &rect)
color = mMonthView->preferences()->monthGridBackgroundColor();
}
if (cell == mScene->selectedCell()) {
color = color.dark(115);
color = color.darker(115);
}
if (cell->date() == QDate::currentDate()) {
color = color.dark(140);
color = color.darker(140);
}
// Draw cell
p->setPen(mMonthView->preferences()->monthGridBackgroundColor().dark(150));
p->setPen(mMonthView->preferences()->monthGridBackgroundColor().darker(150));
p->setBrush(color);
p->drawRect(QRect(mScene->cellHorizontalPos(cell), mScene->cellVerticalPos(cell),
columnWidth, rowHeight));
......@@ -279,8 +279,8 @@ void MonthGraphicsView::drawBackground(QPainter *p, const QRectF &rect)
QLinearGradient bgGradient(QPointF(cellHeaderX, cellHeaderY),
QPointF(cellHeaderX + cellHeaderWidth,
cellHeaderY + cellHeaderHeight));
bgGradient.setColorAt(0, color.dark(105));
bgGradient.setColorAt(0.7, color.dark(105));
bgGradient.setColorAt(0, color.darker(105));
bgGradient.setColorAt(0.7, color.darker(105));
bgGradient.setColorAt(1, color);
p->setBrush(bgGradient);
......@@ -294,7 +294,7 @@ void MonthGraphicsView::drawBackground(QPainter *p, const QRectF &rect)
p->setFont(font);
QPen oldPen = mMonthView->preferences()->monthGridBackgroundColor().dark(150);
QPen oldPen = mMonthView->preferences()->monthGridBackgroundColor().darker(150);
// Draw dates
for (QDate d = mMonthView->actualStartDateTime().date();
......
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