svx/source/gallery2/galctrl.cxx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
New commits: commit 32eba1359efb619f48102980996a484abb6a7715 Author: Sahil Gautam <[email protected]> AuthorDate: Mon Mar 2 16:11:39 2026 +0530 Commit: Mike Kaganski <[email protected]> CommitDate: Fri Mar 6 06:34:22 2026 +0100 tdf#170496 use dark checkered pattern in gallery in dark mode Change-Id: I713cea8ddfeae77ce5fd88d7555011ca379ed592 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200793 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index e96abebb9292..6fc8b4d88508 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -34,6 +34,7 @@ #include <vcl/commandevent.hxx> #include <vcl/graphicfilter.hxx> #include <vcl/svapp.hxx> +#include <vcl/themecolors.hxx> #include <bitmaps.hlst> #include <svl/itemset.hxx> @@ -276,8 +277,25 @@ void GalleryIconView::drawTransparenceBackground(vcl::RenderContext& rOut, const { // draw checkered background static const sal_uInt32 nLen(8); - static const Color aW(COL_WHITE); - static const Color aG(0xef, 0xef, 0xef); + static Color aW(COL_WHITE); + static Color aG(0xef, 0xef, 0xef); + static bool bCheckedAppearanceMode = false; + static bool bIsDarkMode = false; + + if (!bCheckedAppearanceMode) + { + bIsDarkMode = MiscSettings::GetAppColorMode() == AppearanceMode::DARK + || (MiscSettings::GetAppColorMode() == AppearanceMode::AUTO + && MiscSettings::GetUseDarkMode()); + bCheckedAppearanceMode = true; + } + + if (bIsDarkMode) + { + aW = COL_BLACK; + aW.SetAlpha(90); // 90 looks good, no fancy logic otherwise to use 90 here. + aG = COL_TRANSPARENT; + } rOut.DrawCheckered(rPos, rSize, nLen, aW, aG); }
