This fixed drawing problem for scollbar's slider at horizontal orientation.

For smallest size, the slider not will not drawn properly (cut on the right side).

svn path=/trunk/KDE/kdelibs/; revision=1015241
This commit is contained in:
Reza Shah 2009-08-25 00:39:53 +00:00
parent 7890d0c816
commit 9ad7c00c23

View File

@ -138,10 +138,15 @@ void Style::drawComplexControl(ComplexControl control,
subLine.moveCenter(subControlRect(control, option, SC_ScrollBarSubLine, widget).center());
addLine.moveCenter(subControlRect(control, option, SC_ScrollBarAddLine, widget).center());
const QRect slider =
subControlRect(control, option, SC_ScrollBarSlider, widget).adjusted(1, 0, -1, 0);
QRect slider = subControlRect(control, option, SC_ScrollBarSlider, widget);
if (scrollOption && scrollOption->orientation == Qt::Horizontal && d->scrollbar->hasElement("background-horizontal-center")) {
if (scrollOption && scrollOption->orientation == Qt::Horizontal) {
slider.adjust(0, 1, 0, -1);
} else {
slider.adjust(1, 0, -1, 0);
}
/* if (scrollOption && scrollOption->orientation == Qt::Horizontal && d->scrollbar->hasElement("background-horizontal-center")) {
d->scrollbar->setElementPrefix("background-horizontal");
} else if (scrollOption && scrollOption->orientation == Qt::Vertical && d->scrollbar->hasElement("background-vertical-center")) {
d->scrollbar->setElementPrefix("background-vertical");
@ -149,7 +154,7 @@ void Style::drawComplexControl(ComplexControl control,
d->scrollbar->setElementPrefix("background");
}
d->scrollbar->resizeFrame(option->rect.size());
d->scrollbar->paintFrame(painter);
d->scrollbar->paintFrame(painter);*/
if (sunken && scrollOption && scrollOption->activeSubControls & SC_ScrollBarSlider) {
d->scrollbar->setElementPrefix("sunken-slider");