diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-08-27 00:10:30 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-11-09 18:42:25 +0100 |
commit | 351cc2e32914d989bd0a3eda8a7d26b2cce14458 (patch) | |
tree | d0543070b46a1dc6082dd26add9f4a259e7b2143 /vcl | |
parent | 67a300fe537f4f142f9e888e0bec9687fcf0b035 (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.cxx | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 507657a22aa5..c9288aacf566 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -314,35 +314,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()) { |