sc/source/ui/cctrl/checklistmenu.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 7c43a3ad40d394ac60d269c12c3d84f588442c83
Author:     Rafael Lima <rafael.palma.l...@gmail.com>
AuthorDate: Sat Oct 29 23:23:47 2022 +0200
Commit:     Rafael Lima <rafael.palma.l...@gmail.com>
CommitDate: Wed Nov 16 15:27:16 2022 +0100

    tdf#151820 Fix arrow in AutoFilter menu when using dark mode
    
    If you're using a dark theme and create an AutoFilter, the arrows in the 
AutoFilter menu such as "Filter by Color" and "Filter by Condition" will appear 
in black over a dark background.
    
    This patch ensures the arrows use LabelTextColor instead.
    
    Change-Id: Ia41757b801354bbc14f66c293a17f3935734788d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141921
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index f2bbb0eebd11..e0808e1e5915 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -169,11 +169,21 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, 
SetDropdownPosHdl, void*, void)
 
 void ScCheckListMenuControl::CreateDropDown()
 {
+    const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
+
+    // tdf#151820 The color used for the arrow head depends on the background 
color
+    Color aBackgroundColor = rStyleSettings.GetWindowColor();
+    Color aSpinColor;
+    if (aBackgroundColor.IsDark())
+        aSpinColor = rStyleSettings.GetLightColor();
+    else
+        aSpinColor = rStyleSettings.GetDarkShadowColor();
+
     int nWidth = (mxMenu->get_text_height() * 3) / 4;
     mxDropDown->SetOutputSizePixel(Size(nWidth, nWidth));
     DecorationView aDecoView(mxDropDown.get());
     aDecoView.DrawSymbol(tools::Rectangle(Point(0, 0), Size(nWidth, nWidth)),
-                         SymbolType::SPIN_RIGHT, mxDropDown->GetTextColor(),
+                         SymbolType::SPIN_RIGHT, aSpinColor,
                          DrawSymbolFlags::NONE);
 }
 

Reply via email to