From fc6c07c385c08b503512481b996fe404faaf7092 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Thu, 23 Nov 2017 23:07:35 +0200 Subject: [PATCH] [UXTHEME] Add a hack for themed scrollbars - After inspecting a theme file with different upper or lower tracks it seems that windows use what is called LowerTrackHorz and LowerTrackVert in the upper track and UpperTrackHorz and UpperTrackVert are used in the lower track. CORE-13513 --- dll/win32/uxtheme/ncscrollbar.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dll/win32/uxtheme/ncscrollbar.c b/dll/win32/uxtheme/ncscrollbar.c index 8d6f21de697..a44edb00246 100644 --- a/dll/win32/uxtheme/ncscrollbar.c +++ b/dll/win32/uxtheme/ncscrollbar.c @@ -215,16 +215,18 @@ static void SCROLL_DrawInterior( PDRAW_CONTEXT pcontext, SCROLLBARINFO* psbi, return; } + /* Some themes have different bitmaps for the upper and lower tracks + It seems that windows use the bitmap for the lower track in the upper track */ if (vertical) { rcPart = r; rcPart.bottom = thumbPos; - SCROLL_ThemeDrawPart(pcontext, SBP_UPPERTRACKVERT, BUTTON_NORMAL, psbi, SCROLL_TOP_RECT, htDown, htHot, &rcPart); + SCROLL_ThemeDrawPart(pcontext, SBP_LOWERTRACKVERT, BUTTON_NORMAL, psbi, SCROLL_TOP_RECT, htDown, htHot, &rcPart); r.top = rcPart.bottom; rcPart = r; rcPart.top += psbi->xyThumbBottom - psbi->xyThumbTop; - SCROLL_ThemeDrawPart(pcontext, SBP_LOWERTRACKVERT, BUTTON_NORMAL, psbi, SCROLL_BOTTOM_RECT, htDown, htHot, &rcPart); + SCROLL_ThemeDrawPart(pcontext, SBP_UPPERTRACKVERT, BUTTON_NORMAL, psbi, SCROLL_BOTTOM_RECT, htDown, htHot, &rcPart); r.bottom = rcPart.top; SCROLL_ThemeDrawPart(pcontext, SBP_THUMBBTNVERT, BUTTON_NORMAL, psbi, SCROLL_THUMB, htDown, htHot, &r); @@ -234,12 +236,12 @@ static void SCROLL_DrawInterior( PDRAW_CONTEXT pcontext, SCROLLBARINFO* psbi, { rcPart = r; rcPart.right = thumbPos; - SCROLL_ThemeDrawPart(pcontext, SBP_UPPERTRACKHORZ, BUTTON_NORMAL, psbi, SCROLL_TOP_RECT, htDown, htHot, &rcPart); + SCROLL_ThemeDrawPart(pcontext, SBP_LOWERTRACKHORZ, BUTTON_NORMAL, psbi, SCROLL_TOP_RECT, htDown, htHot, &rcPart); r.left = rcPart.right; rcPart = r; rcPart.left += psbi->xyThumbBottom - psbi->xyThumbTop; - SCROLL_ThemeDrawPart(pcontext, SBP_LOWERTRACKHORZ, BUTTON_NORMAL, psbi, SCROLL_BOTTOM_RECT, htDown, htHot, &rcPart); + SCROLL_ThemeDrawPart(pcontext, SBP_UPPERTRACKHORZ, BUTTON_NORMAL, psbi, SCROLL_BOTTOM_RECT, htDown, htHot, &rcPart); r.right = rcPart.left; SCROLL_ThemeDrawPart(pcontext, SBP_THUMBBTNHORZ, BUTTON_NORMAL, psbi, SCROLL_THUMB, htDown, htHot, &r);