hint-scrollbar-size element for scrollbar width/height
This commit is contained in:
parent
957caaae77
commit
95682718bf
@ -331,11 +331,21 @@ int Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWi
|
||||
switch (metric) {
|
||||
case PM_ScrollBarExtent: {
|
||||
d->createScrollbar();
|
||||
const QSizeF hintSize = d->scrollbar->elementSize("hint-scrollbar-size");
|
||||
const QStyleOptionSlider *scrollOption = qstyleoption_cast<const QStyleOptionSlider *>(option);
|
||||
|
||||
if (scrollOption && scrollOption->orientation == Qt::Vertical) {
|
||||
return d->scrollbar->elementSize("arrow-down").width() + 2;
|
||||
if (hintSize.isEmpty()) {
|
||||
return d->scrollbar->elementSize("arrow-down").width() + 2;
|
||||
} else {
|
||||
return hintSize.width();
|
||||
}
|
||||
} else {
|
||||
return d->scrollbar->elementSize("arrow-left").height() + 2;
|
||||
if (hintSize.isEmpty()) {
|
||||
return d->scrollbar->elementSize("arrow-left").height() + 2;
|
||||
} else {
|
||||
return hintSize.height();
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user