From 2236b76ee4bce43d5415a111b1e94d3bdba5cdc6 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 11 Mar 2009 21:03:50 +0000 Subject: [PATCH] ability to have different vertical and horizontal background svn path=/trunk/KDE/kdelibs/; revision=938426 --- private/style.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/private/style.cpp b/private/style.cpp index 007dbe9b9..cd45a53c0 100644 --- a/private/style.cpp +++ b/private/style.cpp @@ -141,7 +141,13 @@ void Style::drawComplexControl(ComplexControl control, const QRect slider = subControlRect(control, option, SC_ScrollBarSlider, widget).adjusted(1, 0, -1, 0); - d->scrollbar->setElementPrefix("background"); + 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"); + } else { + d->scrollbar->setElementPrefix("background"); + } d->scrollbar->resizeFrame(option->rect.size()); d->scrollbar->paintFrame(painter);