diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-08-24 17:18:03 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2020-08-25 14:16:24 +0200 |
commit | 2c9052802ea411dffbf5906c4914611fcbfbc6a5 (patch) | |
tree | e6770ee575093376968135484b373b8d85155927 /include | |
parent | 041fd5a6b8c1f0002cfc693ef66daf28a86df371 (diff) |
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 <m.weghorn@posteo.de>
Tested-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/outdev.hxx | 3 | ||||
-rw-r--r-- | include/vcl/window.hxx | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index df9acf7735a4..d3a1668c81bc 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1979,7 +1979,8 @@ public: const tools::Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, - const OUString& aCaption ); + const OUString& aCaption, + const Color& rBackgroundColor = COL_AUTO ); /** Query the native control's actual drawing region (including adornment) */ diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index f937c9c2503d..42febb1df8a3 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -412,6 +412,7 @@ const char* ImplDbgCheckWindow( const void* pObj ); namespace vcl { class Window; } namespace vcl { class Cursor; } class Dialog; +class Edit; class WindowImpl; class PaintHelper; class VclSizeGroup; @@ -477,6 +478,7 @@ class VCL_DLLPUBLIC Window : public ::OutputDevice friend class ::SystemWindow; friend class ::WorkWindow; friend class ::Dialog; + friend class ::Edit; friend class ::MessBox; friend class ::MessageDialog; friend class ::DockingWindow; |