diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-07-11 02:45:32 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-07-11 16:39:08 +0200 |
commit | d3ed5a8d6b3c86844532927c6450ffddc63549a3 (patch) | |
tree | 635a20d1a133fcfa0d78cacacda202e5d3016597 | |
parent | a72acd89569fe1b7b54a1ffc1d03650d59262c4b (diff) |
Qt5 fix drawing of the toolbar handle
This is visible in Writer, where the 2nd toolbar misses the handle.
Change-Id: Iddf3a002c9d75f668c40977cf02671640b38f083
Reviewed-on: https://gerrit.libreoffice.org/75417
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r-- | vcl/qt5/Qt5Graphics_Controls.cxx | 20 |
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) { |