Commit 11f645b5 authored by Glen Ditchfield's avatar Glen Ditchfield 🐛
Browse files

Color the borders of items in the Agenda view

When the Agenda settings have selected "Tag inside, calendar outside" or
"Calendar inside, tag outside", use the chosen color for a border all
around the item, not just for the header of tall items.  This matches
the appearance of items in the Month view.
parent c8c63b06
Pipeline #99143 passed with stage
in 5 minutes
......@@ -833,7 +833,7 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
const bool roundTop = !prevMultiItem();
const bool roundBottom = !nextMultiItem();
drawRoundedRect(&p, QRect(fmargin, fmargin, width() - fmargin * 2, height() - fmargin * 2), mSelected, bgColor, true, ft, roundTop, roundBottom);
drawRoundedRect(&p, QRect(fmargin, fmargin, width() - fmargin * 2, height() - fmargin * 2), mSelected, bgColor, frameColor, true, ft, roundTop, roundBottom);
// calculate the height of the full version (case 4) to test whether it is
// possible
......@@ -950,6 +950,7 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
QRect(fmargin, fmargin, width() - fmargin * 2, -fmargin * 2 + margin + hlHeight),
mSelected,
frameColor,
frameColor,
false,
ft,
roundTop,
......@@ -962,6 +963,7 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
QRect(fmargin, fmargin, width() - fmargin * 2, -fmargin * 2 + margin + hlHeight),
mSelected,
frameColor,
frameColor,
false,
ft,
roundTop,
......@@ -975,6 +977,7 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
QRect(fmargin, fmargin, width() - fmargin * 2, -fmargin * 2 + margin + hlHeight),
mSelected,
frameColor,
frameColor,
false,
ft,
roundTop,
......@@ -992,6 +995,7 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
QRect(fmargin, fmargin, width() - fmargin * 2, -fmargin * 2 + margin + hlHeight),
mSelected,
frameColor,
frameColor,
false,
ft,
roundTop,
......@@ -1032,7 +1036,7 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
}
}
void AgendaItem::drawRoundedRect(QPainter *p, QRect rect, bool selected, const QColor &bgColor, bool frame, int ft, bool roundTop, bool roundBottom)
void AgendaItem::drawRoundedRect(QPainter *p, QRect rect, bool selected, const QColor &bgColor, const QColor &frameColor, bool frame, int ft, bool roundTop, bool roundBottom)
{
Q_UNUSED(ft)
if (!mValid) {
......@@ -1076,7 +1080,7 @@ void AgendaItem::drawRoundedRect(QPainter *p, QRect rect, bool selected, const Q
path.closeSubpath();
p->save();
p->setRenderHint(QPainter::Antialiasing, false);
const QPen border(QBrush(QColor(200, 200, 200, 255)), 1.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
const QPen border(frameColor, 1.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
p->setPen(border);
// header
......
......@@ -267,7 +267,7 @@ private:
// paint all visible icons
void paintIcons(QPainter *p, int &x, int y, int ft);
void drawRoundedRect(QPainter *p, QRect rect, bool selected, const QColor &bgcolor, bool frame, int ft, bool roundTop, bool roundBottom);
void drawRoundedRect(QPainter *p, QRect rect, bool selected, const QColor &bgColor, const QColor &frameColor, bool frame, int ft, bool roundTop, bool roundBottom);
Q_REQUIRED_RESULT QColor getCategoryColor() const;
Q_REQUIRED_RESULT QColor getFrameColor(const QColor &resourceColor, const QColor &categoryColor) const;
......
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