Windows11Style: simplify subControlRect for CC_ScrollBar
The branches for SC_ScrollBarAddLine and SC_ScrollBarSubLine were identical so avoid code duplication and merge them into one. Pick-to: 6.9 Change-Id: I77a1303badb500a8d8ada3355b34a42a93fb069a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
5b6cbb9c4e
commit
616d33c87a
@ -2026,29 +2026,15 @@ QRect QWindows11Style::subControlRect(ComplexControl control, const QStyleOption
|
|||||||
{
|
{
|
||||||
ret = QCommonStyle::subControlRect(control, option, subControl, widget);
|
ret = QCommonStyle::subControlRect(control, option, subControl, widget);
|
||||||
|
|
||||||
switch (subControl) {
|
if (subControl == SC_ScrollBarAddLine || subControl == SC_ScrollBarSubLine) {
|
||||||
case QStyle::SC_ScrollBarAddLine:
|
|
||||||
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
|
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
|
||||||
if (scrollbar->orientation == Qt::Vertical) {
|
if (scrollbar->orientation == Qt::Vertical)
|
||||||
ret = ret.adjusted(2,2,-2,-3);
|
ret = ret.adjusted(2,2,-2,-3);
|
||||||
} else {
|
else
|
||||||
ret = ret.adjusted(3,2,-2,-2);
|
ret = ret.adjusted(3,2,-2,-2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QStyle::SC_ScrollBarSubLine:
|
|
||||||
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
|
|
||||||
if (scrollbar->orientation == Qt::Vertical) {
|
|
||||||
ret = ret.adjusted(2,2,-2,-3);
|
|
||||||
} else {
|
|
||||||
ret = ret.adjusted(3,2,-2,-2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ret = QWindowsVistaStyle::subControlRect(control, option, subControl, widget);
|
ret = QWindowsVistaStyle::subControlRect(control, option, subControl, widget);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user