Zhiyi Zhang : user32: Use COLOR_BTNFACE to fill scroll bar background.

Alexandre Julliard julliard at winehq.org
Thu Feb 10 16:10:30 CST 2022


Module: wine
Branch: master
Commit: 0457376c0a3a3ae39cf41476157b51e942c6f80d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0457376c0a3a3ae39cf41476157b51e942c6f80d

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Thu Feb 10 14:57:04 2022 +0800

user32: Use COLOR_BTNFACE to fill scroll bar background.

Fix foobar2000 wrong scroll bar size box color when theming is on.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/nonclient.c    | 2 +-
 dlls/user32/scroll.c       | 4 ++--
 dlls/user32/tests/scroll.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index 639cca707fb..a9768defa3c 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -1073,7 +1073,7 @@ static void  NC_DoNCPaint( HWND  hwnd, HRGN  clip )
         else
             r.left = r.right - GetSystemMetrics(SM_CXVSCROLL) + 1;
         r.top  = r.bottom - GetSystemMetrics(SM_CYHSCROLL) + 1;
-        FillRect( hdc, &r,  GetSysColorBrush(COLOR_SCROLLBAR) );
+        FillRect( hdc, &r, GetSysColorBrush( COLOR_BTNFACE ) );
     }
 
     ReleaseDC( hwnd, hdc );
diff --git a/dlls/user32/scroll.c b/dlls/user32/scroll.c
index a3f0becbbd6..c5bfb0b2203 100644
--- a/dlls/user32/scroll.c
+++ b/dlls/user32/scroll.c
@@ -585,7 +585,7 @@ void WINAPI USER_ScrollBarDraw( HWND hwnd, HDC hdc, INT nBar, enum SCROLL_HITTES
         {
             RECT rc = *rect;
 
-            FillRect( hdc, &rc, GetSysColorBrush( COLOR_SCROLLBAR ) );
+            FillRect( hdc, &rc, GetSysColorBrush( COLOR_BTNFACE ) );
             rc.left = max( rc.left, rc.right - GetSystemMetrics( SM_CXVSCROLL ) - 1 );
             rc.top = max( rc.top, rc.bottom - GetSystemMetrics( SM_CYHSCROLL ) - 1 );
             DrawFrameControl( hdc, &rc, DFC_SCROLL, DFCS_SCROLLSIZEGRIP );
@@ -594,7 +594,7 @@ void WINAPI USER_ScrollBarDraw( HWND hwnd, HDC hdc, INT nBar, enum SCROLL_HITTES
 
         if (style & SBS_SIZEBOX)
         {
-            FillRect( hdc, rect, GetSysColorBrush( COLOR_SCROLLBAR ) );
+            FillRect( hdc, rect, GetSysColorBrush( COLOR_BTNFACE ) );
             return;
         }
     }
diff --git a/dlls/user32/tests/scroll.c b/dlls/user32/tests/scroll.c
index c378669991b..154d3c8d434 100644
--- a/dlls/user32/tests/scroll.c
+++ b/dlls/user32/tests/scroll.c
@@ -802,7 +802,7 @@ static void test_visual(void)
 
         hdc = GetDC(hwnd);
         color = GetPixel(hdc, 5, 5);
-        todo_wine_if(styles[i] == SBS_SIZEBOX || bThemeActive)
+        todo_wine_if(bThemeActive)
         ok(color == colors[1], "Expected color %#x, got %#x.\n", colors[1], color);
 
         ReleaseDC(hwnd, hdc);




More information about the wine-cvs mailing list