vcl/qt5/Qt5Graphics_Controls.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
New commits: commit 050a65481452dadf4496d14a27665c690abd9624 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Thu Jul 11 02:45:32 2019 +0000 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat Jul 13 09:34:49 2019 +0200 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 <glo...@fbihome.de> (cherry picked from commit d3ed5a8d6b3c86844532927c6450ffddc63549a3) Reviewed-on: https://gerrit.libreoffice.org/75424 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> 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) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits