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 22:01:25 +0200 |
commit | 4398dc5ff4e9729a6823f63d32011bbfccbac25d (patch) | |
tree | ca83b5c95c84ac4caff79de1977b3613db2978af /vcl/unx/kde4 | |
parent | d96caa5392376f978ccfb751a69edbd18879fe07 (diff) |
implement CTRL_PROGRESS for KDE4
Diffstat (limited to 'vcl/unx/kde4')
-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 71eacd644471..787c3e3fac43 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; } @@ -568,6 +569,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; |