vcl/win/gdi/salnativewidgets-luna.cxx |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 3de945fca589ceb8c79e3b3e16e9e3452b8869e7
Author:     Sahil Gautam <[email protected]>
AuthorDate: Fri Dec 27 02:41:49 2024 +0530
Commit:     Sahil Gautam <[email protected]>
CommitDate: Mon Jan 26 09:39:14 2026 +0100

    Set StyleSettings::DisableColor value in Win
    
    WinSalFrame::UpdateSettings function loads colors from the widget
    toolkit into the StyleSettings objects. Themes uses these colors as
    default values.
    
    I tried using `OpenThemeData(mhWnd, L"Button")` to get the fill color
    value for background color, but didn't get the appropriate color.
    For the time being, modifying the ButtonRect luminance for the disabled
    state. Would replace it with something more appropriate as the Win32
    welding work progresses.
    
    Change-Id: Ied04a8c6c6cb01b1388ef1d744077ae6dfd27b1b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179439
    Reviewed-by: Sahil Gautam <[email protected]>
    Reviewed-by: Heiko Tietze <[email protected]>
    Tested-by: Jenkins
    Tested-by: Heiko Tietze <[email protected]>
    (cherry picked from commit b9464eadfc39c93f7c8beb04dc0d2b94b3a2e841)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198082
    Reviewed-by: Sahil Gautam <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx 
b/vcl/win/gdi/salnativewidgets-luna.cxx
index 3fe486289081..a0095e87d0d5 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -550,25 +550,28 @@ static bool drawThemedControl(HDC hDC, ControlType nType, 
int iPart, int iState,
         if (iPart == BP_PUSHBUTTON)
         {
             Color aButtonColor = 
ThemeColors::GetThemeColors().GetButtonColor();
-            const Color& rButtonRectColor = 
ThemeColors::GetThemeColors().GetDisabledColor();
+            Color aButtonRectColor = 
ThemeColors::GetThemeColors().GetDisabledColor();
 
             if (iState == PBS_PRESSED)
-                aButtonColor.Merge(rButtonRectColor, 230);
+                aButtonColor.Merge(aButtonRectColor, 230);
             else if (iState == PBS_DISABLED)
-                aButtonColor = 
ThemeColors::GetThemeColors().GetDisabledColor();
+                if (UseDarkMode())
+                    aButtonRectColor.DecreaseLuminance(150);
+                else
+                    aButtonRectColor.IncreaseLuminance(150);
             else if (iState == PBS_HOT)
-                aButtonColor.Merge(rButtonRectColor, 170);
+                aButtonColor.Merge(aButtonRectColor, 170);
             else if (iState == PBS_DEFAULTED)
-                aButtonColor.Merge(rButtonRectColor, 150);
+                aButtonColor.Merge(aButtonRectColor, 150);
 
             ScopedHBRUSH hbrush(CreateSolidBrush(RGB(aButtonColor.GetRed(),
                                                      aButtonColor.GetGreen(),
                                                      aButtonColor.GetBlue())));
             FillRect(hDC, &rc, hbrush.get());
 
-            hbrush = 
ScopedHBRUSH(CreateSolidBrush(RGB(rButtonRectColor.GetRed(),
-                                                       
rButtonRectColor.GetGreen(),
-                                                       
rButtonRectColor.GetBlue())));
+            hbrush = 
ScopedHBRUSH(CreateSolidBrush(RGB(aButtonRectColor.GetRed(),
+                                                       
aButtonRectColor.GetGreen(),
+                                                       
aButtonRectColor.GetBlue())));
             FrameRect(hDC, &rc, hbrush.get());
             return true;
         }

Reply via email to