diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-03-21 11:34:53 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-03-21 13:50:12 +0100 |
commit | 29c4d47161dab81971029717ce358de59f52f8c3 (patch) | |
tree | 20226c6b4729db3889290af857bb917b58ecff75 /vcl | |
parent | 22fa995ae81739aa1b7fcc5ffb277d1a46bda452 (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/win/gdi/salnativewidgets-luna.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
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) { |