diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-10-20 19:05:13 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-10-20 19:08:13 +0200 |
commit | 936d19e606cbf29d41bff42db559a01f5deb240c (patch) | |
tree | cd8cbbf147188aad6208822767fc1aaed6fef110 /vcl/unx/kde4 | |
parent | f3e10529134029a7853cdca925bc7091a639bc8a (diff) |
fix horizontal scrollbars with KDE oxygen style (bnc#722918)
Apparently there are two style flags for detecting the widget
is horizontal.
Diffstat (limited to 'vcl/unx/kde4')
-rw-r--r-- | vcl/unx/kde4/KDESalGraphics.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index 5dbe49167a1a..60cd4ed9d802 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -493,10 +493,9 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, if (sbVal->mnVisibleSize < sbVal->mnMax) option.state = QStyle::State_MouseOver; - //horizontal or vertical - if (part == PART_DRAW_BACKGROUND_VERT) - option.orientation = Qt::Vertical; - else + bool horizontal = ( part == PART_DRAW_BACKGROUND_HORZ ); //horizontal or vertical + option.orientation = horizontal ? Qt::Horizontal : Qt::Vertical; + if( horizontal ) option.state |= QStyle::State_Horizontal; //setup parameters from the OO values @@ -592,7 +591,10 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, option.maximum = slVal->mnMax; option.minimum = slVal->mnMin; option.sliderPosition = option.sliderValue = slVal->mnCur; - option.orientation = (part == PART_TRACK_HORZ_AREA) ? Qt::Horizontal : Qt::Vertical; + bool horizontal = ( part == PART_TRACK_HORZ_AREA ); //horizontal or vertical + option.orientation = horizontal ? Qt::Horizontal : Qt::Vertical; + if( horizontal ) + option.state |= QStyle::State_Horizontal; draw( QStyle::CC_Slider, &option, m_image, vclStateValue2StateFlag(nControlState, value) ); } @@ -901,7 +903,10 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p if( part == PART_TRACK_VERT_AREA || part == PART_TRACK_HORZ_AREA ) { QStyleOptionSlider option; - option.orientation = ( part == PART_TRACK_HORZ_AREA ) ? Qt::Horizontal : Qt::Vertical; + bool horizontal = ( part == PART_TRACK_HORZ_AREA ); //horizontal or vertical + option.orientation = horizontal ? Qt::Horizontal : Qt::Vertical; + if( horizontal ) + option.state |= QStyle::State_Horizontal; // getNativeControlRegion usually gets ImplControlValue as 'val' (i.e. not the proper // subclass), so use random sensible values (doesn't matter anyway, as the wanted // geometry here depends only on button sizes) @@ -971,6 +976,8 @@ sal_Bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nP rect.moveTo( 0, 0 ); QStyleOptionSlider options; options.orientation = bHorizontal ? Qt::Horizontal : Qt::Vertical; + if( bHorizontal ) + options.state |= QStyle::State_Horizontal; options.rect = rect; // some random sensible values, since we call this code only for scrollbar buttons, // the slider position does not exactly matter |