summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorRafael Lima <rafael.palma.lima@gmail.com>2023-02-02 15:27:37 +0000
committerMichael Weghorn <m.weghorn@posteo.de>2023-02-10 08:04:40 +0000
commit5c96e813bed3293605f8d746f188cc051d1e5949 (patch)
tree2e39f2b62ee90b6cbbfc2946d97bc865d6947ae8 /vcl/win
parenta80630b6ee6e7636d2c93c42724ce815c991311c (diff)
tdf#150451 Fix borders in Editbox controls (kf5)
The bounding rectangle calculated for an Editbox in QtGraphics_Controls::getNativeControlRegion was not always enough to accommodate content and the borders. The KDE Breeze does not draw any borders if the total height of the bounding rectangle is smaller than the minimum size needed for content + frame at top and bottom, s. Style::drawFrameLineEditPrimitive in the Breeze style [1]. Therefore, ensure a minimum height of that size. The Breeze style also considers the type of the passed widget when retrieving the frame width using QStyle::pixelMetric [2], so pass a dummy `QLineEdit` in order to get the actual frame width of 6 that the Breeze style uses for line edits, rather than the default value of 2 that is returned when not passing any widget. Just do that for the minimum size calculation for now and not everywhere, because the handling for edit boxes here in the qt VCL plugins and in the calling code currently does all kinds of "interesting" things like doing extra size adjustments or passing the content rect where the bounding rect would be expected,... Ideally this should be cleaned up in the callers and all platform integrations in a follow-up commit to adhere to what the doc in vcl/inc/WidgetDrawInterface.hxx says, but this here keeps it working with existing code for now. (s.a. discussion in the Gerrit change for more details) Tested using various scaling factors: 1, 1.25, 1.5, 1.75 and 2.0. [1] https://invent.kde.org/plasma/breeze/-/blob/144ea45018d28758db07afd987d97318d56c4981/kstyle/breezestyle.cpp#L3527 [2] https://invent.kde.org/plasma/breeze/-/blob/144ea45018d28758db07afd987d97318d56c4981/kstyle/breezestyle.cpp#L555 Co-authored-by: Michael Weghorn <m.weghorn@posteo.de> Change-Id: If8cb4794c7f3ce1be4d1ee421c9c27ad5adf5da2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146516 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/win')
0 files changed, 0 insertions, 0 deletions