summaryrefslogtreecommitdiff
path: root/vcl/qt5
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-06-30 17:03:53 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2020-07-01 11:58:42 +0200
commit4bb8bb043f61befd755e090bf966efd24a83c345 (patch)
treed108a4b924823893636f1138a79dc73174dd2a14 /vcl/qt5
parent1eba1c4597f8c2698aa91e2218d8452ad0fbc39c (diff)
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@fbihome.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r--vcl/qt5/Qt5Graphics_Controls.cxx8
1 files changed, 6 insertions, 2 deletions
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;
}