don't put buttons if the theme doesn't have any

This commit is contained in:
Marco Martin 2012-10-09 18:21:01 +02:00
parent 95682718bf
commit bab9b0a1a3

View File

@ -305,6 +305,26 @@ QRect Style::subControlRect(ComplexControl control, const QStyleOptionComplex *o
}
break;
}
case CC_ScrollBar: {
const bool hasButtons = d->scrollbar->hasElement("arrow-up");
switch (subControl) {
//If one of the arrows is missing, don't reserve space for them
case SC_ScrollBarAddLine:
if (!hasButtons) {
rect.setRect(0,0,0,0);
}
break;
case SC_ScrollBarSubLine:
if (!hasButtons) {
rect.setRect(0,0,0,0);
}
break;
default:
break;
}
}
default:
break;
}