diff options
author | Sami Merila <sami.merila@nokia.com> | 2009-12-11 13:35:57 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2009-12-11 13:35:57 (GMT) |
commit | d1fd7e611651bea5497048c8f16df8de9618f6ba (patch) | |
tree | 92461fcdea8aa8c0dee5a1cd3199050a11474a08 /src/gui/styles/qs60style.cpp | |
parent | 57a4d8279a64a7844c2a2bf2b45846563c4c3eb5 (diff) | |
download | Qt-d1fd7e611651bea5497048c8f16df8de9618f6ba.zip Qt-d1fd7e611651bea5497048c8f16df8de9618f6ba.tar.gz Qt-d1fd7e611651bea5497048c8f16df8de9618f6ba.tar.bz2 |
QS60Style: Groove changes caused build break of S60 3.1
3.1 does not have theme graphics IDs that we use in style, so it
cannot be compiled in 3.1. As a fallback, 3.1 will use the previous
method of drawing a slider.
Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui/styles/qs60style.cpp')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index f33ad5d..17db53d 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -958,10 +958,24 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom drawPrimitive(PE_FrameFocusRect, optionSlider, painter, widget);*/ //Groove graphics - const QS60StylePrivate::SkinElements grooveElement = horizontal ? - QS60StylePrivate::SE_SliderGrooveHorizontal : - QS60StylePrivate::SE_SliderGrooveVertical; - QS60StylePrivate::drawSkinElement(grooveElement, painter, sliderGroove, flags); + if (QS60StylePrivate::hasSliderGrooveGraphic()) { + const QS60StylePrivate::SkinElements grooveElement = horizontal ? + QS60StylePrivate::SE_SliderGrooveHorizontal : + QS60StylePrivate::SE_SliderGrooveVertical; + QS60StylePrivate::drawSkinElement(grooveElement, painter, sliderGroove, flags); + } else { + const QRect sliderGroove = subControlRect(control, optionSlider, SC_SliderGroove, widget); + const QPoint sliderGrooveCenter = sliderGroove.center(); + const bool horizontal = optionSlider->orientation == Qt::Horizontal; + painter->save(); + if (widget) + painter->setPen(widget->palette().windowText().color()); + if (horizontal) + painter->drawLine(0, sliderGrooveCenter.y(), sliderGroove.right(), sliderGrooveCenter.y()); + else + painter->drawLine(sliderGrooveCenter.x(), 0, sliderGrooveCenter.x(), sliderGroove.bottom()); + painter->restore(); + } //Handle graphics const QRect sliderHandle = subControlRect(control, optionSlider, SC_SliderHandle, widget); |