Commit 77ff1b8c authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Cleanup of the "empty-editor-focus" painting

Using the proper editor area (was cut off on the top). Not using
expensive alpha transparency anymore, but rather a slightly darker
color. Removing years-old rotten code that was in an '#if 0'.
parent bf9ba67b
......@@ -534,37 +534,11 @@ void SplitterOrView::paintEvent(QPaintEvent *)
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(Qt::NoPen);
QColor shadeBrush(Qt::black);
shadeBrush.setAlpha(10);
painter.setBrush(shadeBrush);
painter.setBrush(palette().color(QPalette::Background).darker(107));
const int r = 3;
painter.drawRoundedRect(rect().adjusted(r, r, -r, -r), r * 2, r * 2);
#if 0
if (hasFocus()) {
#ifdef Q_WS_MAC
// With QMacStyle, we have to draw our own focus rect, since I didn't find
// a way to draw the nice mac focus rect _inside_ this widget
if (qobject_cast<QMacStyle *>(style())) {
painter.setPen(Qt::DotLine);
painter.setBrush(Qt::NoBrush);
painter.setOpacity(0.75);
painter.drawRect(rect());
} else {
#endif
QStyleOptionFocusRect option;
option.initFrom(this);
option.backgroundColor = palette().color(QPalette::Background);
// Some styles require a certain state flag in order to draw the focus rect
option.state |= QStyle::State_KeyboardFocusChange;
style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter);
#ifdef Q_WS_MAC
}
#endif
}
#endif
const QRect areaGlobal(view()->editorArea());
const QRect areaLocal(mapFromGlobal(areaGlobal.topLeft()), areaGlobal.size());
painter.drawRoundedRect(areaLocal.adjusted(r , r, -r, -r), r * 2, r * 2);
}
SplitterOrView *SplitterOrView::findFirstView()
......
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