summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-08-27 00:10:30 +0200
committerJan Holesovsky <kendy@collabora.com>2018-11-08 09:14:31 +0100
commita6386e555c0be5f1e4710e6f0b12057fbbe9f6eb (patch)
tree909996120802923e9969ddbba7a02324e99dc780 /vcl
parentf8ec1bde36faa982f2b2d405b10f0a75e6c3d906 (diff)
vcl: make slider ask if native drawing is supported
Slider drawing didn't we ask if native drawing is supported using IsNativeControlSupported method. Change-Id: I0672114337516ff763fd710d949ab6a982db2992
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/slider.cxx44
1 files changed, 24 insertions, 20 deletions
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index 61075e8b89e4..c2af3bf820bc 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -315,35 +315,39 @@ void Slider::ImplCalc( bool bUpdate )
void Slider::ImplDraw(vcl::RenderContext& rRenderContext)
{
- DecorationView aDecoView(&rRenderContext);
- DrawButtonFlags nStyle;
- const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- bool bEnabled = IsEnabled();
-
// do missing calculations
if (mbCalcSize)
ImplCalc(false);
ControlPart nPart = (GetStyle() & WB_HORZ) ? ControlPart::TrackHorzArea : ControlPart::TrackVertArea;
- ControlState nState = (IsEnabled() ? ControlState::ENABLED : ControlState::NONE);
- nState |= (HasFocus() ? ControlState::FOCUSED : ControlState::NONE);
- SliderValue sldValue;
- sldValue.mnMin = mnMinRange;
- sldValue.mnMax = mnMaxRange;
- sldValue.mnCur = mnThumbPos;
- sldValue.maThumbRect = maThumbRect;
-
- if (IsMouseOver())
+ if (rRenderContext.IsNativeControlSupported(ControlType::Slider, nPart))
{
- if (maThumbRect.IsInside(GetPointerPosPixel()))
- sldValue.mnThumbState |= ControlState::ROLLOVER;
+ ControlState nState = (IsEnabled() ? ControlState::ENABLED : ControlState::NONE);
+ nState |= (HasFocus() ? ControlState::FOCUSED : ControlState::NONE);
+
+ SliderValue aSliderValue;
+ aSliderValue.mnMin = mnMinRange;
+ aSliderValue.mnMax = mnMaxRange;
+ aSliderValue.mnCur = mnThumbPos;
+ aSliderValue.maThumbRect = maThumbRect;
+
+ if (IsMouseOver())
+ {
+ if (maThumbRect.IsInside(GetPointerPosPixel()))
+ aSliderValue.mnThumbState |= ControlState::ROLLOVER;
+ }
+
+ const tools::Rectangle aCtrlRegion(Point(0,0), GetOutputSizePixel());
+
+ if (rRenderContext.DrawNativeControl(ControlType::Slider, nPart, aCtrlRegion, nState, aSliderValue, OUString()))
+ return;
}
- const tools::Rectangle aCtrlRegion(Point(0,0), GetOutputSizePixel());
- bool bNativeOK = rRenderContext.DrawNativeControl(ControlType::Slider, nPart, aCtrlRegion, nState, sldValue, OUString());
- if (bNativeOK)
- return;
+ DecorationView aDecoView(&rRenderContext);
+ DrawButtonFlags nStyle;
+ const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
+ bool bEnabled = IsEnabled();
if (!maChannel1Rect.IsEmpty())
{