diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-11-19 11:23:33 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2020-11-19 18:10:24 +0100 |
commit | 771f1411c588a02ed276febc9a479323bf4232cd (patch) | |
tree | b91ad5135c2c24083f650731c0ba91b41ede53bf /vcl/qt5 | |
parent | 70d2d1945a06dc6ec4f605e7462369a2f4937975 (diff) |
tdf#138010 (II) getNativeControlRegion (gtk3/kf5): Consider frame's border
Take the frame border/padding into account when calculating
the content rectangle (i.e. the area that can safely be
drawn into without overlapping the actual frame) when
calculating dimensions in 'getNativeControlRegion' regardless
of the exact 'DrawFrameFlags' being passed.
Previously, gtk3 and qt5 only did this when the
'DrawFrameFlags::NoDraw' flag was passed in addition,
but the actual drawing routine 'drawNativeControl'
does not make any such distinction, so the frame ended
up at a place that was still in the "content rectangle"
as calculated previously (which was the same as the bounding
rect).
Returning the actual content rect is a prerequisite
for making 'VclScrolledWindow' take the width of a natively
drawn frame into account, which will be done in a
follow-up commit.
Change-Id: I8d3a3fbd387108a24a0478e3465c8950e6d59735
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106155
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Graphics_Controls.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx index 6f88d66a1c3b..9d6779621234 100644 --- a/vcl/qt5/Qt5Graphics_Controls.cxx +++ b/vcl/qt5/Qt5Graphics_Controls.cxx @@ -901,13 +901,8 @@ bool Qt5Graphics_Controls::getNativeControlRegion(ControlType type, ControlPart { if (part == ControlPart::Border) { - auto nStyle = static_cast<DrawFrameFlags>(val.getNumericVal() & 0xFFF0); - if (nStyle & DrawFrameFlags::NoDraw) - { - int nFrameWidth - = upscale(pixelMetric(QStyle::PM_DefaultFrameWidth), Round::Ceil); - contentRect.adjust(nFrameWidth, nFrameWidth, -nFrameWidth, -nFrameWidth); - } + int nFrameWidth = upscale(pixelMetric(QStyle::PM_DefaultFrameWidth), Round::Ceil); + contentRect.adjust(nFrameWidth, nFrameWidth, -nFrameWidth, -nFrameWidth); retVal = true; } break; |