Commit 4db79f2c authored by Jens Bache-Wiig's avatar Jens Bache-Wiig
Browse files

Fixes: Fix mac problems in collapse highlight

parent ee5fb31f
...@@ -2258,24 +2258,24 @@ static void drawRectBox(QPainter *painter, const QRect &rect, bool start, bool e ...@@ -2258,24 +2258,24 @@ static void drawRectBox(QPainter *painter, const QRect &rect, bool start, bool e
painter->save(); painter->save();
painter->setRenderHint(QPainter::Antialiasing, false); painter->setRenderHint(QPainter::Antialiasing, false);
QColor c = pal.highlight().color(); QColor c = pal.highlight().color();
c.setAlpha(36); c.setAlpha(40);
QLinearGradient grad(rect.topLeft(), rect.topRight()); QLinearGradient grad(rect.topLeft(), rect.topRight());
grad.setColorAt(0, c.darker(130)); grad.setColorAt(0, c.darker(130));
grad.setColorAt(1, c.lighter(150)); grad.setColorAt(1, c.lighter(160));
QColor outline = c.darker(110); QColor outline = c.darker(110);
outline.setAlpha(100); outline.setAlpha(100);
QRect r = rect;
painter->fillRect(rect, grad);
painter->setPen(outline); painter->setPen(outline);
QRect r = rect.adjusted(0, 0, 0, -1); if (start)
painter->setBrush(grad); painter->drawLine(rect.topLeft() + QPoint(1, 0), rect.topRight() - QPoint(1, 0));
painter->save(); if (end)
painter->setClipRect(rect.adjusted(0, 0, -1, 0)); painter->drawLine(rect.bottomLeft() + QPoint(1, 0), rect.bottomRight() - QPoint(1, 0));
if (!start)
r.adjust(0,-3, 0 ,0); painter->drawLine(rect.topRight() + QPoint(0, start ? 1 : 0), rect.bottomRight() - QPoint(0, end ? 1 : 0));
if (!end) painter->drawLine(rect.topLeft() + QPoint(0, start ? 1 : 0), rect.bottomLeft() - QPoint(0, end ? 1 : 0));
r.adjust(0, 0, 0, 3);
painter->drawRoundedRect(r, 3, 3);
painter->restore();
painter->drawLine(rect.topRight(), rect.bottomRight());
painter->restore(); painter->restore();
} }
...@@ -2488,10 +2488,12 @@ void BaseTextEditor::drawFoldingMarker(QPainter *painter, const QPalette &pal, ...@@ -2488,10 +2488,12 @@ void BaseTextEditor::drawFoldingMarker(QPainter *painter, const QPalette &pal,
s = ms->systemStyle(); s = ms->systemStyle();
// QGtkStyle needs a small correction to draw the marker in the right place // QGtkStyle needs a small correction to draw the marker in the right place
if (qstrcmp(s->metaObject()->className(), "QGtkStyle") == 0) if (!qstrcmp(s->metaObject()->className(), "QGtkStyle") == 0 ||
!qstrcmp(s->metaObject()->className(), "QMacStyle") == 0)
opt.rect.translate(-2, 0); opt.rect.translate(-2, 0);
s->drawPrimitive(QStyle::PE_IndicatorBranch, &opt, painter, this); s->drawPrimitive(QStyle::PE_IndicatorBranch, &opt, painter, this);
} }
void BaseTextEditor::slotModificationChanged(bool m) void BaseTextEditor::slotModificationChanged(bool m)
......
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