Draw all borders for QScrollBar in Fusion style
Fixes: QTBUG-116400 Change-Id: I0409202652032c5662d4e324a157a444272fbb16 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>bb10
parent
4373c4436a
commit
413d79656a
|
|
@ -2439,7 +2439,6 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||
subtleEdge.setAlpha(40);
|
||||
painter->setPen(subtleEdge);
|
||||
painter->setBrush(Qt::NoBrush);
|
||||
painter->setClipRect(scrollBarGroove.adjusted(1, 0, -1, -3));
|
||||
painter->drawRect(scrollBarGroove.adjusted(1, 0, -1, -1));
|
||||
painter->restore();
|
||||
}
|
||||
|
|
@ -2482,7 +2481,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||
else
|
||||
painter->setBrush(gradient);
|
||||
|
||||
painter->drawRect(pixmapRect.adjusted(horizontal ? -1 : 0, horizontal ? 0 : -1, horizontal ? 0 : 1, horizontal ? 1 : 0));
|
||||
painter->drawRect(pixmapRect.adjusted(horizontal ? -1 : 0, horizontal ? 0 : -1, horizontal ? 0 : -1, horizontal ? -1 : 0));
|
||||
|
||||
painter->setPen(d->innerContrastLine());
|
||||
painter->drawRect(scrollBarSlider.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, -1, -1));
|
||||
|
|
@ -2512,16 +2511,9 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||
painter->drawRect(scrollBarSubLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, 0, 0));
|
||||
painter->setPen(QPen(alphaOutline));
|
||||
if (option->state & State_Horizontal) {
|
||||
if (option->direction == Qt::RightToLeft) {
|
||||
pixmapRect.setLeft(scrollBarSubLine.left());
|
||||
painter->drawLine(pixmapRect.topLeft(), pixmapRect.bottomLeft());
|
||||
} else {
|
||||
pixmapRect.setRight(scrollBarSubLine.right());
|
||||
painter->drawLine(pixmapRect.topRight(), pixmapRect.bottomRight());
|
||||
}
|
||||
painter->drawRect(scrollBarSubLine.adjusted(horizontal ? 0 : 1, 0, horizontal ? 1 : 0, horizontal ? -1 : 0));
|
||||
} else {
|
||||
pixmapRect.setBottom(scrollBarSubLine.bottom());
|
||||
painter->drawLine(pixmapRect.bottomLeft(), pixmapRect.bottomRight());
|
||||
painter->drawRect(scrollBarSubLine.adjusted(0, 0, horizontal ? 0 : -1, 0));
|
||||
}
|
||||
|
||||
QRect upRect = scrollBarSubLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, horizontal ? -2 : -1, horizontal ? -1 : -2);
|
||||
|
|
@ -2549,16 +2541,9 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||
painter->drawRect(scrollBarAddLine.adjusted(horizontal ? 0 : 1, horizontal ? 1 : 0, 0, 0));
|
||||
painter->setPen(QPen(alphaOutline, 1));
|
||||
if (option->state & State_Horizontal) {
|
||||
if (option->direction == Qt::LeftToRight) {
|
||||
pixmapRect.setLeft(scrollBarAddLine.left());
|
||||
painter->drawLine(pixmapRect.topLeft(), pixmapRect.bottomLeft());
|
||||
} else {
|
||||
pixmapRect.setRight(scrollBarAddLine.right());
|
||||
painter->drawLine(pixmapRect.topRight(), pixmapRect.bottomRight());
|
||||
}
|
||||
painter->drawRect(scrollBarAddLine.adjusted(horizontal ? -1 : 0, 0, horizontal ? -1 : 0, horizontal ? -1 : 0));
|
||||
} else {
|
||||
pixmapRect.setTop(scrollBarAddLine.top());
|
||||
painter->drawLine(pixmapRect.topLeft(), pixmapRect.topRight());
|
||||
painter->drawRect(scrollBarAddLine.adjusted(0, horizontal ? 0 : -1, horizontal ? 0 : -1, horizontal ? 0 : -1));
|
||||
}
|
||||
|
||||
QRect downRect = scrollBarAddLine.adjusted(1, 1, -1, -1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue