summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/qt5/Qt5Graphics_Controls.cxx20
1 files changed, 8 insertions, 12 deletions
diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx
index 32a2d132efc5..08e57f53f5a6 100644
--- a/vcl/qt5/Qt5Graphics_Controls.cxx
+++ b/vcl/qt5/Qt5Graphics_Controls.cxx
@@ -399,24 +399,20 @@ bool Qt5Graphics_Controls::drawNativeControl(ControlType type, ControlPart part,
}
else if ((type == ControlType::Toolbar)
&& (part == ControlPart::ThumbVert || part == ControlPart::ThumbHorz))
- { // reduce paint area only to the handle area
+ {
+ // reduce paint area only to the handle area
const int handleExtend = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
QStyleOption option;
- option.state = vclStateValue2StateFlag(nControlState, value);
-
- QPainter painter(m_image.get());
+ QRect aRect = m_image->rect();
if (part == ControlPart::ThumbVert)
{
- option.rect = QRect(0, 0, handleExtend, widgetRect.height());
- painter.setClipRect(widgetRect.x(), widgetRect.y(), handleExtend, widgetRect.height());
- option.state |= QStyle::State_Horizontal;
+ aRect.setWidth(handleExtend);
+ option.state = QStyle::State_Horizontal;
}
else
- {
- option.rect = QRect(0, 0, widgetRect.width(), handleExtend);
- painter.setClipRect(widgetRect.x(), widgetRect.y(), widgetRect.width(), handleExtend);
- }
- QApplication::style()->drawPrimitive(QStyle::PE_IndicatorToolBarHandle, &option, &painter);
+ aRect.setHeight(handleExtend);
+ draw(QStyle::PE_IndicatorToolBarHandle, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value), aRect);
}
else if (type == ControlType::Editbox || type == ControlType::MultilineEditbox)
{