From 29c4d47161dab81971029717ce358de59f52f8c3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 21 Mar 2022 11:34:53 +0000 Subject: Related: tdf#118320 tabpane is too white in darkmode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- vcl/win/gdi/salnativewidgets-luna.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'vcl') 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) { -- cgit