diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-04-08 17:55:14 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-04-08 21:56:42 +0200 |
commit | c18254958873207a6b92dc3fd71557af959e6c23 (patch) | |
tree | ac60f779bce0aef37d3ca4e12f77211a94b8bb81 /vcl | |
parent | 611282fff7d558f401a2cc8fe94462259963a8d6 (diff) |
implement CTRL_PROGRESS for KDE4
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/kde4/KDESalGraphics.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index ddfb06ccd64d..8fad2fa33d5b 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -146,12 +146,13 @@ sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart if (type == CTRL_SLIDER && (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA) ) return true; + if ( (type == CTRL_PROGRESS) && (part == PART_ENTIRE_CONTROL) ) return true; + return false; if ( (type == CTRL_TAB_ITEM) && (part == PART_ENTIRE_CONTROL) ) return true; if ( (type == CTRL_TAB_PANE) && (part == PART_ENTIRE_CONTROL) ) return true; // no CTRL_TAB_BODY for KDE - if ( (type == CTRL_PROGRESS) && (part == PART_ENTIRE_CONTROL) ) return true; return false; } @@ -566,6 +567,18 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CC_Slider, &option, m_image, vclStateValue2StateFlag(nControlState, value) ); } + else if( type == CTRL_PROGRESS && part == PART_ENTIRE_CONTROL ) + { + QStyleOptionProgressBarV2 option; + option.minimum = 0; + option.maximum = widgetRect.width(); + option.progress = value.getNumericVal(); + option.rect = QRect(0, 0, widgetRect.width(), widgetRect.height()); + option.state = vclStateValue2StateFlag( nControlState, value ); + + draw( QStyle::CE_ProgressBar, &option, m_image, + vclStateValue2StateFlag(nControlState, value) ); + } else { returnVal = false; |