vcl/source/window/toolbox.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
New commits: commit 9eb920f5f780107e57b2aacbcab661f24bd114b9 Author: Dan Williams <[email protected]> AuthorDate: Thu Jan 8 13:29:49 2026 -0600 Commit: Dan Williams <[email protected]> CommitDate: Wed Feb 25 16:41:48 2026 +0100 vcl: draw Toolbox button images inverted in High Contrast mode Currently on mouse-over toolbar button images are displayed in their Disabled state, which is a dark-gray that is very hard to see on top of the black background of the mouse-over. Use the new DrawImageFlags Invert flag to make them much more visible. Change-Id: I1717fc8c18c88fa6c35a39f6c96d1a50478ea3ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196873 Tested-by: Jenkins Reviewed-by: Dan Williams <[email protected]> diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 764925fc455e..4755dea25f44 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -2600,12 +2600,6 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si const Image* pImage = &(pItem->maImage); aImageSize = pImage->GetSizePixel(); - // determine drawing flags - DrawImageFlags nImageStyle = DrawImageFlags::NONE; - - if ( !pItem->mbEnabled || !IsEnabled() ) - nImageStyle |= DrawImageFlags::Disable; - // #i35563# the dontknow state indicates different states at the same time // which should not be rendered disabled but normal @@ -2635,6 +2629,14 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si ImplDrawButton(rRenderContext, aButtonRect, nHighlight, pItem->meState == TRISTATE_TRUE, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow); } + + // determine drawing flags + DrawImageFlags nImageStyle = DrawImageFlags::NONE; + if ( nHighlight && rStyleSettings.GetHighContrastMode() ) + nImageStyle |= DrawImageFlags::Invert; + else if ( !pItem->mbEnabled || !IsEnabled() ) + nImageStyle |= DrawImageFlags::Disable; + rRenderContext.DrawImage(Point( nImageOffX, nImageOffY ), *pImage, nImageStyle); }
