From 2c9052802ea411dffbf5906c4914611fcbfbc6a5 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 24 Aug 2020 17:18:03 +0200 Subject: tdf#136094 Handle background color in drawNativeControl Make gtk3's 'GtkSalGraphics::drawNativeControl' take into account a control's background color, if any is explicitly set: Set background/fill color (in 'Edit::ApplySettings') also for the case where the control is drawn "natively", but don't draw the background in the generic 'Window::Erase' method for the case of native drawing; instead handle it when drawing the control itself. This adds an additional parameter to pass the background color to the relevant '{d,D}rawNativeControl' methods (defaulting to 'COL_AUTO') and implements the required handling to apply the background color for the gtk3 case. qt5/kf5 will probably be handled in an upcoming commit as well. Windows as well as the "gen" VCL plugin were not affected by the issue, so remain unchanged and just ignore the new parameter. In a quick test on on macOS, the rendering of the controls in the sample doc was broken beyond just the missing background colors (s. screenshot attached to tdf#136094); the behavior there also remains unchanged by this patch, the new parameter is ignored for now. Change-Id: I01923a504fea2367ae96032104f09099e35f410e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101284 Reviewed-by: Michael Weghorn Tested-by: Michael Weghorn --- vcl/osx/salnativewidgets.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vcl/osx') diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index 940fd4138b4b..e01470a58e76 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -260,7 +260,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, - const OUString &) + const OUString &, + const Color&) { bool bOK = false; if (!CheckContext()) -- cgit