Commit 33b68e14 authored by Jens Bache-Wiig's avatar Jens Bache-Wiig
Browse files

Fixes: Prettify the block highlighting

I softened it ut to make it significantly less
parent 61d3f55b
...@@ -2255,29 +2255,28 @@ void BaseTextEditor::slotUpdateExtraAreaWidth() ...@@ -2255,29 +2255,28 @@ void BaseTextEditor::slotUpdateExtraAreaWidth()
static void drawRectBox(QPainter *painter, const QRect &rect, bool start, bool end, static void drawRectBox(QPainter *painter, const QRect &rect, bool start, bool end,
const QPalette &pal) const QPalette &pal)
{ {
painter->setRenderHint(QPainter::Antialiasing, false); painter->setRenderHint(QPainter::Antialiasing, false);
const QColor c = pal.highlight().color(); QColor c = pal.highlight().color();
QLinearGradient grad(rect.topRight(), rect.topLeft()); QLinearGradient grad(rect.topLeft(), rect.topRight());
grad.setColorAt(0, c.lighter(110)); grad.setColorAt(0, c.darker(130));
grad.setColorAt(1, c); grad.setColorAt(1, c.lighter(150));
QColor outline = c.darker(110);
painter->fillRect(rect, grad); outline.setAlpha(100);
QColor white = Qt::white; QRect r = rect.adjusted(0, 0, 0, -1);
white.setAlpha(128); painter->setBrush(grad);
QColor black = Qt::black; painter->save();
black.setAlpha(32); painter->setClipRect(rect.adjusted(0, 0, -1, 0));
if (!start)
painter->setPen(white); r.adjust(0,-3, 0 ,0);
painter->drawLine(rect.topLeft(), rect.bottomLeft()); if (!end)
if (start) r.adjust(0, 0, 0, 3);
painter->drawLine(rect.topLeft(), rect.topRight()); painter->drawRoundedRect(r, 3, 3);
painter->drawLine(rect.topRight(), rect.bottomRight()); painter->drawLine(rect.topRight(), rect.bottomRight());
if (end) painter->restore();
painter->drawLine(rect.bottomLeft(), rect.bottomRight());
} }
void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e) void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
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