vcl/win/gdi/salnativewidgets-luna.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 29c4d47161dab81971029717ce358de59f52f8c3
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Mar 21 11:34:53 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Mar 21 13:50:12 2022 +0100

    Related: tdf#118320 tabpane is too white in darkmode
    
    the only reliable darkmode hammers are a button or drawing with some
    solid color derived from a theme element, try a button here
    
    Change-Id: I842a415020abd26dc60e51438f9fd3c961ecd830
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131902
    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 a544bf03c77d..1266c022bb89 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -750,7 +750,12 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, 
RECT rc,
 
     if( nType == ControlType::TabPane )
     {
-        iPart = TABP_PANE;
+        // tabpane in tabcontrols gets drawn in "darkmode" as if it was a
+        // a "light" theme, so bodge this by drawing with a button instead
+        if (UseDarkMode())
+            iPart = BP_PUSHBUTTON;
+        else
+            iPart = TABP_PANE;
         return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
     }
 
@@ -1172,10 +1177,10 @@ bool WinSalGraphics::drawNativeControl( ControlType 
nType,
                 hTheme = getThemeHandle(mhWnd, L"Combobox", mpImpl.get());
             }
             break;
-        case ControlType::TabPane:
         case ControlType::TabBody:
             hTheme = getThemeHandle(mhWnd, L"Tab", mpImpl.get());
             break;
+        case ControlType::TabPane:
         case ControlType::TabItem:
             if (bUseDarkMode)
             {

Reply via email to