[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/qt5

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 1 18:10:32 UTC 2020


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

New commits:
commit 499ea815432eee3d0555aae96927c2568dbaf5d5
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Tue Jun 30 17:03:53 2020 +0200
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Wed Jul 1 20:10:00 2020 +0200

    tdf#134054 Qt5 really scale the toolbox button
    
    I missed that code in the HiDPI patch. Instead of some fixed 25px
    size, use the real content size and ask the QStyle for the real
    size.
    
    Change-Id: I227190baab2c1716aa40ef6d16d55dbded0830cc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97538
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
    (cherry picked from commit 36a95b632173d1131c9da5737d2e2958eb4594ce)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97577
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx
index ee7b43d86d86..6f54e6f189ea 100644
--- a/vcl/qt5/Qt5Graphics_Controls.cxx
+++ b/vcl/qt5/Qt5Graphics_Controls.cxx
@@ -935,8 +935,12 @@ bool Qt5Graphics_Controls::getNativeControlRegion(ControlType type, ControlPart
             }
             else if (part == ControlPart::Button)
             {
-                contentRect = QRect(boundingRect.left(), boundingRect.top(),
-                                    upscale(25, Round::Ceil), upscale(25, Round::Ceil));
+                QStyleOptionToolButton option;
+                option.arrowType = Qt::NoArrow;
+                option.features = QStyleOptionToolButton::None;
+                option.rect = downscale(QRect({ 0, 0 }, contentRect.size()));
+                contentRect = upscale(
+                    subControlRect(QStyle::CC_ToolButton, &option, QStyle::SC_ToolButton));
                 boundingRect = contentRect;
                 retVal = true;
             }


More information about the Libreoffice-commits mailing list