vcl/win/gdi/salnativewidgets-luna.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit c43c4a00089b1965c7ef69ef40c9e645dffc2e43
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Mar 18 21:09:29 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Mar 19 11:40:26 2022 +0100

    Related: tdf#118320 darkmode DrawThemeBackground doesn't work for tab bodies
    
    so just draw it as solid window color
    
    Change-Id: I4e452a7d6a21be91da8e23901746064fd33ee386
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131842
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx 
b/vcl/win/gdi/salnativewidgets-luna.cxx
index c4113b877f1f..805db681a211 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -756,6 +756,17 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, 
RECT rc,
 
     if( nType == ControlType::TabBody )
     {
+        // tabbody in main window gets drawn in white in "darkmode", so bodge 
this here
+        if (UseDarkMode())
+        {
+            Color 
aColor(Application::GetSettings().GetStyleSettings().GetWindowColor());
+            ScopedHBRUSH hbrush(CreateSolidBrush(RGB(aColor.GetRed(),
+                                                     aColor.GetGreen(),
+                                                     aColor.GetBlue())));
+            FillRect(hDC, &rc, hbrush.get());
+            return true;
+        }
+
         iPart = TABP_BODY;
         return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
     }
@@ -840,7 +851,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, 
RECT rc,
                     rc.top = 0; // extend potential gradient to cover menu bar 
as well
             }
 
-            // menubar in main window gets drawn in white in "darkmode", so 
bodge this here
+            // toolbar in main window gets drawn in white in "darkmode", so 
bodge this here
             if (UseDarkMode())
             {
                 Color 
aColor(Application::GetSettings().GetStyleSettings().GetWindowColor());

Reply via email to