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,27 +2026,13 @@ QRect QWindows11Style::subControlRect(ComplexControl control, const QStyleOption
|
||||
{
|
||||
ret = QCommonStyle::subControlRect(control, option, subControl, widget);
|
||||
|
||||
switch (subControl) {
|
||||
case QStyle::SC_ScrollBarAddLine:
|
||||
if (subControl == SC_ScrollBarAddLine || subControl == SC_ScrollBarSubLine) {
|
||||
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);
|
||||
} else {
|
||||
else
|
||||
ret = ret.adjusted(3,2,-2,-2);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user