[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - vcl/qt5

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 13 07:35:22 UTC 2019


 vcl/qt5/Qt5Graphics_Controls.cxx |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

New commits:
commit 050a65481452dadf4496d14a27665c690abd9624
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Jul 11 02:45:32 2019 +0000
Commit:     Michael Weghorn <m.weghorn at 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 <glogow at fbihome.de>
    (cherry picked from commit d3ed5a8d6b3c86844532927c6450ffddc63549a3)
    Reviewed-on: https://gerrit.libreoffice.org/75424
    Reviewed-by: Michael Weghorn <m.weghorn at 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)
     {


More information about the Libreoffice-commits mailing list